Inter-process communication between browser extension and native application

How can I establish interprocess communication between a browser extension and a native application? Is there a cross-platform (Linux and Mac OS X) and cross-browser solution (Firefox, Chrome, Safari)?

The only idea that comes to my mind is to use your own web technologies, that is, to embed the HTTP server in your own application and use XmlHttpRequest or WebSockets. However, this sounds like a clumsy overkill with a handful of problems (like security). Is there a better alternative?

+7
google-chrome-extension firefox-addon ipc browser-extension safari-extension
source share
1 answer

I believe that the most commonly used method is to connect to websocket. Two examples I can think of are 1Password and LiveReload ( source ).

As far as I know, you need to open a connection to a web server on your global page to avoid cross-domain restrictions.

In addition, in the past I have seen other applications observe and modify the extension settings file. The extension simply reads and writes its own settings repository from it, while another process looks at the settings file for changes. I believe it is less reliable and does not meet the sandbox requirements for the Mac App Store, so I would recommend the websockets method.

+9
source share

All Articles