Is there a way to locate Google Chrome automatically - NodeJS - node.js

Problem
I have an electron + puppeteer application which uses the chrome on users computer (Windows and MacOS).
However the problems arises some users have chrome on different locations than set in my program, this leads to program not working completely.
Objective
Is there any NodeJs module to detect chrome location on a PC automatically like registry or something? Or is there a way for puppeteer to detect chrome?

Related

Chromium-Browser ignores --allow-file-access-from-files flag

Environment
I am using Chromium 78.0.3904.108 Built on Raspbian running on Raspbian 10 on a Raspberry 3b+.
I am opening up a bundled VueJs app via file:// protocol directly in the browser. The app files are locally available on the machine. Until now everything works as expected. The app displays and works fine !
Problem
The website files contain a html <video> tag to play mp4 video files, which are locally available as well. However, a console error is telling me Not allowed to load local resource: file:///home/path/to/the/video/file/abc.mp4
I am very aware of this issue, it's an inbuilt security feature of the browser. However, the machine will only load content owned by me, so I guess I should be safe ignoring the warning.
Expected behaviour
By passing --allow-file-access-from-files to chromium-browser I expected it would disable this security feature. Doesn't work. I tried --disable-web-security as well. Same result.
I tested the same vue app bundled into an electron executable and having the electron option "webSecurity" set to false, the content is able to play without the warning. However, since the playback performance in electron is notable lower than compared the chromium-browser directly, I was trying to use the browser directly.

Node JS web application to LAN application( Desktop App)

I am very new to Node JS. recently developed a web application in NodeJS & hosted it on a common server along with Database for a clinical management.
Now I have an immediate requirement of making it as a desktop application so that users in a clinic can run the exe on their desktop and the application where its installed will create a database for other users to connect and make their updates.
Checked articles with Electron, node-webkit but didn't work for my current solution.
Is there any other alternative solution where I can make it as a desktop for Windows and Mac. Seeking your kind help !!!
There is the software NEXE which shows promising results however, when it comes down too it, Node.JS is a perfectly fine platform for production environments and is quite performant for the use-case you suggest. You can bundle a Node.JS installation and call upon it from your C code using system, exec or spawn calls. You can also open your favourite browser from the command line, while Google Chrome has the --kiosk flag to show in widescreen by default.
Just some ideas.

Native messaging of Chrome extension

I am running an example application that uses native messaging on OS X.
After downloading an example of chrome, I registered an extension and located a native messaging host file at /Library/Google/Chrome/NativeMessagingHosts/com.google.chrome.example.echo.json.
According to the guide, Chrome starts a native messaging host in a separate process.
But I cannot look for that process.
Is there a way for chrome to run host process?
What do I miss?
The sample app provided by Chrome is a packaged app. Once you install it you have to launch it from your browser. And then do ps ax and look for the sample python-script process.
To run the app, start chrome and go to the following URL:
chrome-extension://knldjmfmopnpolahpmmgbagdohdnhkik/main.html
If you've done everything right, it should start the python script and you should see a window.
if its not working, have a look at chrome's console. you could also enable additional chrome logs - see here: http://www.chromium.org/for-testers/enable-logging

Selenium on shared gui-less host

I need to run Selenium (or another webscraping tool that can handle javascript) on a remote linux host (Webfaction). I am using Python.
Is this possible? The server is gui-less so I can't run browsers. Or can I, if I use PyVirtualDisplay?
What about running Selenium with HtmlUnit?
I have tried using Selenium with Selenium/PyVirtualDisplay/ChromeDriver, but keep getting various error messages. So I'm wondering if this is even possible before I continue to debug something impossible.
If you need to handle JavaScript Selenium/Webdriver seems to be a good solution.
If you need to run headless, GhostDriver (instead of ChromeDriver) is an excellent alternative. It is based on PhantomJS, a headless browser based itself on Webkit. It has full JS-support.

JPlayer issues with Firefox 3.6.4

I'm having some issues with the JPlayer widget.
I'm using JPlayer 1.1.1 with Firefox 3.6.4 and I'm testing this locally on my laptop. I'm all setup to use local domains i.e. http://mylocaldomain, etc.
I have JPlayer in a folder under htdocs called myfolder that I access by going to http://myfolder. I have a test script setup just like the playlist demo on the JPlayer Web site (http://www.happyworm.com/jquery/jplayer/latest/demo-02.htm).
When I load my test script in Firefox it plays like half a second of the audio track. However, my script works fine using Safari and Chrome, and plays the tracks in sequence.
Is there a way to not use the .swf as I have been seeing in other posts as it's becoming really annoying trying to debug this for Firefox when it works in other browsers. I've tried various swfPath settings but it still doesn't work.
I just completed a JPlayer project using Firefox 3.6.10 as the main dev browser, and JPlayer 1.2.0, and I did not see an issue with it cutting off as you describe. You might try upgrading to JPlayer 1.2.
However there is this in the dev guide:
"Firefox 3.6 (Windows, Mac) †
...
* When using {oggSupport: true}, the browser appears to enable file seeking, which can cause the music to pause briefly when a new play position is selected."
Again, I don't think I saw the problem you mentioned. However, that means I do have working code. Have you tested on multiple machines, and what OS are you running Firefox on?
Try loading my application in your Firefox ( http://alinesoundscape.org/ )and see if it works. If so, I can post the relevant parts of my source and you can compare with what you have.

Resources