从Chrome扩展程序执行程序

编程入门 行业动态 更新时间:2024-10-26 23:40:48
本文介绍了从Chrome扩展程序执行程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

谷歌浏览器NPAPI 正在分阶段实施。

不使用NPAPI,是否有任何方法允许扩展在本地系统上执行命令?

解决方案

有 chrome.runtime.sendNativeMessage ,可用于向本机应用程序发送消息并 chrome .runtime.connectNative ,它允许更持久的连接。

所以,你不能直接执行一个命令,但你可以一个本地应用程序为你做。

你可以在 文档 。

The Google Chrome NPAPI is being phased out.

Without using NPAPI, is there any way to allow an extension to execute a command on the local system?

解决方案

There is chrome.runtime.sendNativeMessage which can be used to send a message to a native application and chrome.runtime.connectNative which allows for a more persistent connection.

So, you can't directly execute a command, but you can have a native app do it for you.

You can find more info on Native Messaging in the docs.

更多推荐

从Chrome扩展程序执行程序

本文发布于:2023-11-13 09:29:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1584009.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:程序   Chrome

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!