0

我正在尝试将 crx 文件放在服务器上。该页面正在加载,但没有产生任何错误。

以下是一些信息,如果有人可以提供帮助 - 非常感谢。

服务器是 apache2,我在 mime.types 中添加了行 application/x-chrome-extension

在我的html页面中:

</script>
</head>
<body onload='init()'>
<pre id='output'></pre>
<embed type="application/x-chrome-extension" id="complex" width='0' height='0'  
        pluginspage="complex_to_pack.crx"/>
 </body>
</html>

和 manifest.json:

{
 // Required
 "name": "complex",
 "version": "1",
 "manifest_version": 2,
 "plugins": [
 { "path": "npcomplex.dll", "public": true }
 ]
 }
4

1 回答 1

0

从您对 HTTP 服务器配置的描述来看,您似乎没有设置 content-type,这很可能默认为X-Content-Type-Options: no sniff,它必须是以下之一:

empty string
"text/plain"
"application/octet-stream"
"unknown/unknown"
"application/unknown"
"*/*"

根据 chrome 扩展的托管文档 ( http://developer.chrome.com/extensions/hosting.html ) -

"The most common reason for failing to recognize an installable file is that the server sends the header X-Content-Type-Options: no sniff. The second most common reason is that the server sends an unknown content type—one that isn't in the previous list. To fix an HTTP header issue, either change the configuration of the server or try hosting the .crx file at another server."

于 2012-10-20T15:51:25.193 回答