How to access installed apps through browser - google-chrome

1password's chrome extension checks to see if the app is installed on your desktop before you can actually do anything.
I was wondering on how could I implement something similar?

This is probably implemented using the Native Messaging API.
Alternatively, the app can simply have a web server / websockets server open on the local machine, but it would mean the connection will only work while the app is running.

Related

chrome.enterprise.deviceAttributes availability for force-installed PWAs in chrome enterprise

I'm trying to determine if I can access any browser api for chrome OS that will allow me to identify the device that its running on when the application has been force-installed in kiosk mode as a PWA.
We're running into exactly the same issue right now. The correct path seems to be to create a PWA and to connect it to a (pre-installed) extension that has access to the enterprise.deviceAttributes:
See https://developers.chrome.com/apps/migration:
"If there is a capability that your Chrome App has that the regular web platform can't provide, it might be available as an extension API. In this case, you use a progressive web app together with an externally connectable extension your web app can send messages to."
enterprise.deviceAttributes are only accessible if the calling App/Site is pre-installed to the device and not loaded dynamically, so it cannot run in the PWA by design.
But with this tutorial, it seems possible:
https://developer.chrome.com/extensions/messaging#external-webpage
We're looking into that right now and will post our progess here.

How Google Chrome extension check if a specific app installed on the client machine or not?

i want to know if it is possible for google chrome extension to check if there is already a native app installed on the client machine or not
So we established that you control both the extension and the native app.
Note that the extension cannot access the filesystem to check for existence of files; presumably, you also want to detect the presence of the app even if it's not running, and ideally be able to launch it if it isn't.
The best way to check that the app is installed is to provide a Native Messaging host in the app. The installer would then add a registry key to let Chrome know that the native host is present, and you can connect to it.
Now, there are some considerations:
You can't check the presence of the native host without trying to launch it.
The process launched that way lives only as long as its communication port is opened in the extension.
The communication channel between the extension and the app is the STDIO.
It would not be wise to just declare your main Windows Forms app as the native host. You should write a separate utility app that can communicate according to the Native Messaging protocol (even if to just answer "I'm here"). If needed, it can launch the main app and/or communicate with it as needed using other channels. You could also just launch the main app from your native host and then communicate with it using WebSockets.

Communication between Chrome extension and running Windows service

I am developing chrome extension which needs to communicate with my running service. I tried to use Chrome Native messaging, but I didn't manage to make the extension communicate with running service.
I did manage to communicate with native (not already running app), as described here:
Google chrome native messaging
It's impossible for Native Messaging to "connect" to an already-running process.
Therefore, you have to either use something else (a local WebSockets server in your service is a good alternative idea) or make the Native Messaging host be some sort of "proxy": you can start a new one from Chrome, and it uses some other channel to communicate with the already-running service.

Chrome Application Doesn't Use System Proxy

A Chrome Packaged Application under Windows 10 doesn't seem to be using my public proxy settings under Internet Options. I'm trying to monitor this application's network activity via Fiddler installed on another computer. Every HTTP and HTTPS requests are successfully monitored there, except the ones from this packaged application.
I'm pretty sure it uses HTTP requests behind, because I generated it from an Android APK file, using ARC Welder. And I can see HTTP requests from Android application itself on my phone. But not from generated packaged chrome application on Windows. Is there anything I can do with the manifest file or something else?
Thank you.
chrome.sockets API does not use the Chrome browser proxy settings.
On ChromeOS, chrome.sockets will respect the system-wide VPN settings, however.

can chrome extension connect to backend application in the desktop

is there any way with chrome extension to get / set parameters with command line application in the desktop ?
with out using npnpi ? maybe http?
No there is not any feasible way to do it for security reasons. However you can register a custom protocol like example:// and install a program on client system to handle your custom protocol. Hope this helps!