Electron and Native Messaging - google-chrome-extension

I am loading an extension that uses NativeMessaging inside an Electron app. When I launch the app, I am getting a "Access to the native messaging host was disabled by the system administrator." error. I have tried adding registry keys for Chrome Policies with no success.
Any help or suggestions would be appreciated. Thank you.

Related

Run VS Code Web Extension with full nodejs APIs support in VS Code Desktop

I am developing a web extension that works well on the vscode.dev with client-based OAuth but when I need to use the same in desktop vscode, the JS Domain i.e. location.origin is coming to be vscode-file://vscode-app which I can't use as JS domain for OAuth2. This results in CORS errors for API calls.
Hence, I need to use the server-based OAuth method to avoid CORS errors.
For this, I need to run the http.createServer method from nodejs when the extension runs in the vscode desktop.
This means that some parts of my source code will work in vscode. dev (i.e. nodejs independent) while others will only work in VS Code desktop (i.e. nodejs dependent).
Can anyone guide me on how to go about implementing the same for my project?
P.S. - I want to provide some functionalities in vscode.dev and some extra functionalities in VS Code Desktop hence I need this hybrid approach.

Chrome extension error Package is invalid: 'CRX_HEADER_INVALID' from chrome store

When I import the app locally on my machine it works fine. It also used to work on the chrome store. I recently uploaded and update and now "Package is invalid: 'CRX_HEADER_INVALID'." I don't know what is causing this.
Contacted google support and they fixed the issue.

How do I setup and deploy a local execution app for Google smart home action?

I am implementing the local execution functionality for my google smart home action. I am following the steps in this link:
https://developers.google.com/actions/smarthome/develop/local
I have already configured the scanning data in the console, and now I am trying to deploy my local execution app. I know how to program in javascript, I have created a couple of firebase functions, but I am not an expert in node.js. I don't understand how to setup and run this javascript app.
I tried to run it on the browser, but it says it cannot find "require", and I read that node.js is not supposed to run on client side. In the link above, it says to create an index.html, that declares the "local_execution.js". Is this javascript module going to run on client side? Can someone point me in the right direction? Maybe explain how to setup the app directory.
Thank you in advance,
Henrique
The best place to get started would be with the local home sample app on GitHub. This sample includes both a local execution app and a compatible virtual device, with instructions to get it compiled and deployed.
For testing, you need to host the web app (HTML/JavaScript) in a location that's accessible to your Home device. This could be a local dev server or something like Firebase Hosting (the sample has instructions for both). The hosted URL goes in the console under Test > On device testing.
I tried to run it on the browser, but it says it cannot find "require", and I read that node.js is not supposed to run on client side.
The Home devices run a browser-based (Chrome) environment, so your JavaScript must be compatible with the browser. If you use Node programming paradigms (e.g. importing modules using require) in your code, you need to use a bundler tool such as Webpack or Parcel to package the code for the browser. The sample uses Webpack to accomplish this.
Side Note: You can't run even a properly packaged local home app in the browser on your development machine because the local home SDK only exists on Home devices.

how can i track my mobile app user when the app is killed

i want to implement tracking in my app but i am confused on how to get the location from the app if the app is not opened and send it to the server i tried socket , GPS-tracking but it did not work.
can any one guide me to how this is implemented and any resources or libraries to use ?
For Android projects React Native includes headless JS that does just what you are asking.
iOS is more complicated but the best solution I've found is a package called React Native Background Geolocation
Unfortunately this is not possible in a PWA without a plugin due to W3C's and Jake Archibald's refusal to implement the TravelManager detailed here
If the TravelManager were to be implemented a ServiceWorker intance would be automatically spun up on change of location in order to foreground your Web App or instantiate a new instance.

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

Resources