wtjones
wtjones

Reputation: 4160

How do I perform a shell execute in a chrome extension?

I'm not finding a way to do this in the chrome.* API or even the experimental. It doesn't run through wscript so ActiveXObject("Shell.Application") isn't allowed.

I fear that my only option is to build a dll with NPAPI but I wanted to see if there was a simpler way.

Upvotes: 18

Views: 28696

Answers (3)

mgalgs
mgalgs

Reputation: 16769

To update this for a fellow wary lonesome traveler, even NPAPI is deprecated and being phased out. One of the alternatives mentioned in the NPAPI deprecation blog post that looks suitable for this type of problem (and pretty nifty really) is the Native Messaging API.

Upvotes: 15

John Henry
John Henry

Reputation: 3193

Alternatively, you might want to have two applications:

  1. a "client" that works within a chrome extension and
  2. a "local server" where the actual command is executed.

Whenever the extension needs to execute a command, it can connect to the local server via tcp connection.

Upvotes: 7

Mohamed Mansour
Mohamed Mansour

Reputation: 40149

If you want to do anything Natively, you need to use NPAPI. That allows you to run code outside the sandbox for your extensions.

http://code.google.com/chrome/extensions/npapi.html

Upvotes: 8

Related Questions