推荐文章

html+css右上角红点提示

html+css右上角红点提示

右上角提示红点,用在未读信息提醒或待处理提示等等
AI图标编辑SVG的方法

AI图标编辑SVG的方法

使用Adobe Illustrator制作无锯齿图标
UEditor在线编辑器

UEditor在线编辑器

UEditor 是由百度「FEX前端研发团队」开发的所见即所得富文本web编辑器,具有轻量,可定制,注重用户体验等特点,开源基于MIT协议,允许自由使用和修改代码。
UEditor工具条配置toolbars

UEditor工具条配置toolbars

UEditor工具条toolbars配置
Ueditor辑器中的 setContent()方法的使用

Ueditor辑器中的 setContent()方法的使用

Ueditor辑器中的 setContent()方法的使用

Chrome Extensions扩展NPAPI插件

日期:2019-03-20 点击:2902 来源:PB2.CN

在你扩展的manifest.json文件中加入一个节,描述如何找到你的插件,以及其他一些信息,: 

{
  "name": "My extension",
  ...
  "plugins": [
    { "path": "content_plugin.dll", "public": true },
    { "path": "extension_plugin.dll" }
  ],
  ...
}

"path" 属性用于描述如何找到你的插件,路径是相对于manifest文件位置的。 "public" 属性指明是否允许普通页面加载你的插件,默认是false,也就是只有你的扩展才能加载这个插件。

创建一个HTML文件,mime-type为:application/x-my-extension" ,用于加载你的插件。 

<embed type="application/x-my-extension" id="pluginId">
<script>
  var plugin = document.getElementById("pluginId");
  var result = plugin.myPluginMethod();  // call a method in your plugin
  console.log("my plugin returned: " + result);
</script>

这个页面可以被后台页面包含,或者任何你扩展会用到的其他页面。如果你的插件的 "public" 属性是true,,你可以通过脚本在页面中直接使用它。


这篇文档对您是否有帮助?

上一篇:edge插件开发
下一篇:Chrome Extension开发
html+css右上角红点提示

html+css右上角红点提示

右上角提示红点,用在未读信息提醒或待处理提示等等
AI图标编辑SVG的方法

AI图标编辑SVG的方法

使用Adobe Illustrator制作无锯齿图标
UEditor在线编辑器

UEditor在线编辑器

UEditor 是由百度「FEX前端研发团队」开发的所见即所得富文本web编辑器,具有轻量,可定制,注重用户体验等特点,开源基于MIT协议,允许自由使用和修改代码。
UEditor工具条配置toolbars

UEditor工具条配置toolbars

UEditor工具条toolbars配置
Ueditor辑器中的 setContent()方法的使用

Ueditor辑器中的 setContent()方法的使用

Ueditor辑器中的 setContent()方法的使用