Search code examples
google-chrome-extension

How to execute a command line from Google Chrome Extension?


Is it possible to run/execute a command line from a Google Chrome Extension?

For example, an user clicks on specific link and a local shell program is automatically executed.

Currently, my need concerns only Mac OS X.

Merci a lot !


Solution

  • Maybe you can solve your problem with this post from google groups https://groups.google.com/a/chromium.org/forum/#!topic/chromium-extensions/WaG-xr-jzaQ

    Specially this:

    You will have to use the Native Messaging API. It is more involved than just calling a function. You have to build an executable (the native host, in native code, like C++) that Chrome will start and use Chrome APIs to communicate with it. The native host is run with the same privileges as Chrome and can do or executes whatever it wants (as long as Chrome can, obviously).

    For more information https://developer.chrome.com/docs/extensions/develop/concepts/native-messaging