Javascript shell command execution from Firefox we

2019-07-28 12:06发布

It's been noticed by all web extension developers that Firefox is going to stop SDK support (API that allows shell execution in client side) and will only accept web extensions.

Due to above-mentioned changes, I'm trying to get a shell command executed by javascript code in Firefox's web extensions' API.

I'm dealing with a web page that executes the web extension (I solved it by using javascript events), but the real trouble is that I need to execute a shell command in the javascript main code to open client programs such as LibreOffice or a background Java code and I don't know how to achieve it.

It's also necessary to execute these shell commands on Windows, OSX and Linux.

1条回答
家丑人穷心不美
2楼-- · 2019-07-28 12:51

You can't directly run a shell command but native messaging lets you exchange messages with a specific native application that could launch other applications on your extension's behalf: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Native_messaging

查看更多
登录 后发表回答