Javascript shell command execution from Firefox web extensions

*爱你&永不变心* 提交于 2019-12-24 05:45:07

问题


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:


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



来源:https://stackoverflow.com/questions/44183413/javascript-shell-command-execution-from-firefox-web-extensions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!