Chrome Extension: Failed to start native messaging host - google-chrome

I'm developing a Chrome extension using Native Messaging technology.
The extension works but on some PC I get an error:
Failed to start native messaging host
Some (not all) of those PCs are running Windows 7 and Windows XP:
Windows 7: the PC has a lock icon on the user folder C:\Users. I can fix it as per the tutorial and restart the PC to make my extension work.
Windows XP: I have not found any solution for this error.
According to nativeMessaging documentation I think the problem is related to filesystem security permissions of chrome.exe file and native host application file.
I've asked many times about this problem on other groups and searched on google but haven't found a solution.
How to check the permissions of chrome.exe file or native host application file are okay?
Any other way to solve this problem?

Xan comment is correct. --enable-native-messaging not needed.
Udpated:
Finally, this answer Failed to start native messaging host on Windows, "COMSPEC is not set" hellped me.
Need add ComSpec in System variables.

Related

Tried to connect a device to web via webusb but.. Failed to claim interface: Access denied (insufficient permissions)

I am using the webusb API in Google Chrome to try to connect a device to the browser. It worked with webserial API, but I am having trouble getting it to work with webusb API.
I am using HTTPS (Github pages)
I enabled #new-usb-backend for my browser
I can open the device and select configuration, but device.claimInterface(0) is not working (and I can confirm that 0 is an interface number).
None of the two interfaces this device has seems to be claimed
The error I get looking at chrome://device-log is
Failed to claim interface: Access denied (insufficient permissions)
I'm not sure where to go from here. I would appreciate some help.
Thank you.
device.claimInterface(1) worked. I heard somewhere mac automatically claims interfaces. Perhaps the first interface was claimed, although the api indicated otherwise. Anyhow, something about the second interface worked that didn't work in the first.
That error message indicates that there is either an existing driver that has claimed the interface or (Windows only) the WinUSB driver hasn't attached to the interface in order to enable applications like your browser to claim it. On Windows you can use the Zadig tool to force Windows to change the drivers being used for a USB device.
If the device can be opened using the Web Serial API then that indicates that the operating system has already loaded a serial driver for the device and so it has claimed at least some of the device's interfaces.
Why, if the Web Serial API works to connect to your device, are you trying to connect to it with the WebUSB API instead? Are you now on a different operating system which doesn't provide a USB serial driver compatible with the device?

Headless Chrome fails under IIS but works on command line

I am wrapping headless chrome using the excellent ChromeHtmlToPDF library. This we are using to dynamically render PDFs from a website. This works locally under IIS express, and also works on the server when recompiled as a console app, so the technology works. However running under IIS, chrome always exits immediately and a error of "one or more parameters are invalid", is returned.
You can fix this by passing Chrome a custom user profile directory:
chrome.exe --user-data-dir="C:\NewChromeProfile" ...
This directory will be created by the account under which Chrome is running, and therefore the account will have the permissions it needs.
After many many hours looking into this I finally solved it by running it under my own user, the restricted IIS user, then comparing the activity logs generated by the excellent microsoft process monitor.
I tracked it down to file permissions on one directory: C:\Windows\System32\config\systemprofile\AppData\Local\Google\Chrome\User Data
The app pool user needs write + modify permissions to this directory. It's up to you if you feel this is an acceptable security risk; however for us it is, for now.
This is where headless chrome stores it's crashpad directory. No amount of parameter fiddling seems to be able to dissuade it of this. That seems to be a bug.
Hope this helps someone else, I couldn't find anything on this anywhere.

Using getUserMedia() on insecure origins in Chrome

I am developing a webpage that uses camera. When I test in Chrome in my local network, camera doesn't work and I get warning in the console:
getUserMedia() no longer works on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See link for more details.
In the link provided there is an instruction to set some flags in Chrome. So I tried. My command looks like this:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --unsafely-treat-insecure-origin-as-secure="192.168.0.15" --user-data-dir=c:\chrome-dev-profile
But when I run Chrome I get this message:
You are using an unsupported command-line flag: --unsafely-treat-insecure-origin-as-secure. Stability and security will suffer.
What am I doing wrong?
Is there another way I can test in local network without setting up https server? I need this just for development.
Luka,
I've run into this bug just yesterday. I have not found out how to get Chrome to honor that flag on the command line yet. But I did find a workaround that works for my case.
I'm running my web services on a Linux machine that is running an ssh server. I'm testing on windows with chrome, and used putty to connect to the linux box from windows and then created a "local port forward" to make my remote linux box's ipaddress:port appear on localhost:port on windows. Depending on your platform this workaround may work for you. This approach isn't too cumbersome if you only have a few ports to forward.
In my particular case my setting for putty looked like
L8080 localhost:8080
To see more about port forwarding and ssh see: https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding

DEP0100 - deployment failed due to a developer licensing issue windows 10 while trying to remote a windows store app

When I try to deploy a windows 10 app using remote debugger, I get this error "DEP0100 - deployment failed due to a developer licensing issue windows 10 while trying to remote a windows store app."
From what I understand, there is no concept of windows developer licensing in windows 10, all I have to do is to enable developer mode from settings.
I have still tried to renew developer license using powershell.
Is there any solution for this issue?
PS. Remote debugging was working earlier, it suddenly started giving this error.
Edit: This is happening only when remote debugger is running as a service.
This may seem like a really dumb solution, but I had the same issue and couldn't find what's wrong, until I enabled developer mode and it all worked.
To enable developer mode on Windows 10:
Click Start
Type "For Developers Settings"
Switch to "Developer Mode"
Not sure about this, but make sure the account you're using to run the service is allowed to do developer stuff on your machine.
Here's what I would do:
Generate an account on the machine with admin rights (e.g.
"myadminuser")
Log in as "myadminuser" and enable developer mode for
that account on the machine. (You might have to provide a Microsoft
account here) This will allow the account to install apps.
Configure the service to run with user "myadminuser".
I didn't try this, but this should work.

Windows Store App Cert Kit Fails to Start

The Windows Store App Cert kit fails to start.
Normally the flow is:
Start App Cert Kit
Choose Windows Store Application
Choose App
Choose Certs to Run
Run Certs
Save results
Currently, it fails just before 'Choose App'.
I get this result:
I have tried uninstalling and reinstalling, installed all updates, running appcert.exe reset. All to no avail.
I think it may have to do with the same issue I get with the Windows Store app. I have 38 languages installed (our app supports all of them) and the Windows Store app doesn't like it. I've had to escalate with customer support repeatedly for this, and have not had it resolved properly. I wonder if the same issue applies here.
So I was unable to start the UI, but I was still able to run the appcert by manually calling it on the command line as described here. It worked fine. One thing to note is that between each attempt, make sure to run appcert.exe reset.