I need to write a plugin for Chrome which, if running on Windows and the browser's URL matches something specific, can open a named pipe to a certain process running on the OS.
What's the best choice of plugin for Chrome? Should I go with a Native Client or can I use something less intrusive (although I realize named pipes by definition are quite intrusive)?
Google Chrome To view the plug-ins installed in Chrome, type chrome://plugins into Chrome's address bar and press Enter. This page shows all the installed browser plug-ins enabled in Google Chrome. To disable a plug-in, click the Disable link under it.
A named pipe is a named, one-way or duplex pipe for communication between the pipe server and one or more pipe clients. All instances of a named pipe share the same pipe name, but each instance has its own buffers and handles, and provides a separate conduit for client/server communication.
To create an instance of a named pipe by using CreateNamedPipe, the user must have FILE_CREATE_PIPE_INSTANCE access to the named pipe object. If a new named pipe is being created, the access control list (ACL) from the security attributes parameter defines the discretionary access control for the named pipe.
Native Client is indeed sandboxed, as indicated by the comments, and NPAPI is retired.
Two current solutions for contacting a running native app are those:
Use HTTP, optionally with WebSockets, with the native application (or a proxy application that will talk to a third-party app using any native method, including pipes) acting as a server on localhost
and the extension trying to connect to a known port. GhostText is an example of this architecture.
Use Native Messaging. It's important to understand limitations of this approach:
So with those limitations in mind, your Native Host would be a proxy that will, itself, attach to the named pipe in question and relay the data, translating it to/from the Native Messaging protocol.
You know, strangely enough I just noticed you can view named pipes via:
file://./pipe/
I discovered this when I was reading the Wikipedia article about them, copied it, and then later thought I copied a URL and accidentally pasted that into chrome instead.
You can't even access that from explorer or the file system.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With