【发布时间】:2015-12-06 02:49:39
【问题描述】:
我想将外部插件添加到运行我的外部程序的 chrome 中,根据 thishttps://developer.chrome.com/extensions/npapi我们可以在 chrome 中添加外部插件。我编辑了 external_plugin.json 文件和 html 代码,但仍然 chrome 说插件不受支持.我知道 chrome NPAPI 正在被逐步淘汰。但他们也说应该只在没有其他方法可行的情况下使用。 我别无选择,只能使用 chrome,请帮助
{
"name": "npmeadax.dll",
...
"plugins": [
{ "path": "C:\Program Files (x86)\MeadCo Neptune\npmeadax.dll" }
],
...
}
<script type="text/javascript">
function loadPage() {
var lh = location.href;
var embed = document.createElement('embed');
embed.setAttribute('width','70%');
embed.setAttribute('height','90%');
embed.setAttribute('type','application/x-meadco-neptune-ax');
embed.setAttribute('param-location',lh);
var tbody = document.getElementsByTagName('body')[0];
tbody.appendChild(embed);
try {
WshShell = new ActiveXObject("WScript.Shell");
WshShell.run("C:/folderName/myfile.exe");
}
catch(e) {}
}
</script>
【问题讨论】:
标签: json google-chrome npapi activexobject