如何在 chrome 扩展中执行 shell 执行?
我没有找到在 chrome.* API 甚至实验中执行此操作的方法。它不通过 wscript 运行,所以 不允许使用 ActiveXObject("Shell.Application")
。
我担心我唯一的选择是使用 NPAPI 构建 dll,但我想看看是否有更简单的方法。
I'm not finding a way to do this in the chrome.* API or even the experimental. It doesn't run through wscript soActiveXObject("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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
为了给一个谨慎的孤独旅行者更新这一点,甚至 NPAPI 也被弃用并被逐步淘汰。 NPAPI 弃用博客文章中提到的替代方案之一看起来适合这种类型问题(而且确实很漂亮)是 Native Messaging API。
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.
如果你想本地做任何事情,你需要使用 NPAPI。这允许您在沙箱之外为您的扩展运行代码。
http://code.google.com/chrome/extensions/npapi.html
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
或者,您可能需要两个应用程序:
每当扩展需要执行命令时,它可以通过 tcp 连接连接到本地服务器。
Alternatively, you might want to have two applications:
Whenever the extension needs to execute a command, it can connect to the local server via tcp connection.