Native messaging of Chrome extension - google-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

Related

Selenium Web driver with Azure Web jobs

i have written a C# selenium code which opens browser and takes the screenshot . Code is running fine in my local laptop but when i try to deploy the code on azure webjobs. code fails to run. It may be because of local system has chrome browser installed whereas it is missing from cloud. I have even included the chrome.exe file with my directory but not finding a success. i am stuck and tried many thing but not found a way to proceed .
Selenium is not supported by Azure Web App/Web Jobs currently. It's noted under Unsupported frameworks tags.
Azure Web App sandbox:Unsupported frameworks
Other scenarios that are not supported:
PhantomJS/Selenium: tries to connect to local address, and also uses
GDI+.

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.

Chromium browser instance as a service

I'm working on web scraping application that uses node.js, puppeteer and Chromium. When I run the script it launches Chromium browser and executes the script using puppeteer package for scraping a web page.
To improve the performance I want to eliminate the launching of the Chromium browser instance.
I thinking of Chromium browser instance as a service so that I can connect to it and execute the script. Just like a database pooling connection.
I think you are looking for the "browserless/chrome" docker. Take a look at it.
To eliminate the launching of the Chromium instance, I use it like this:
docker run -e "PREBOOT_CHROME=true" -e "EXIT_ON_HEALTH_FAILURE=true" -e "CONNECTION_TIMEOUT=3600000" browserless/chrome
The flag that you are looking for is the "PREBOOT_CHROME=true". The other ones works for my use case, but maybe you don't need it. Take a look at the docs.
Regards.

Chrome web server extension - running an app locally

I am looking to use Web Server for Chrome extension only for the localhost in order to run an app:
https://chrome.google.com/webstore/detail/web-server-for-chrome/ofhbbkphhbklhfoeikjpcbhemlocgigb?hl=en
It's easier for me to use this Chrome add on rather than installing Python or XAMPP.
Is it possible to run an app locally this way. If you want to test pages built with Angular, is it possible this way also.
Thanks

How can I debug J2V8/node.js when running within JVM?

Typically, I use node inspector (https://github.com/node-inspector/node-inspector) to debug node.js. Can this be used to attach to a remote node.js instance running in the JVM via J2V8?
Also, it looks like the dev version of node.js supports native Chrome debugging: https://github.com/nodejs/node/pull/6792. If J2V8 adopts this version of node.js, will I be able to simply attach the Chrome debugger directly to the JVM?
If the question is still relevant - I have created j2v8-debugger library.
It allows debugging J2V8 using Chrome DevTools.
Basic features like setting/removing breakpoints, step into, step out and step over, variables inspection, etc. are implemented.
It uses Stetho lib for communication with Chrome DevTools.
Also it's uses DebugHandler for accessing V8 debug information.
If you need need to debug J2V8, which runs on non-Android JVM you would need to use another lib for communication to Chrome DevTools, but likely you could re-use all the logic from this project as it's basically POJO/JSON, which are send over web socket.
Hope it could be helpful.

Resources