首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >部署chrome扩展

部署chrome扩展
EN

Stack Overflow用户
提问于 2012-10-09 21:57:34
回答 1查看 125关注 0票数 0

我在试着把一个crx文件放到服务器上。页面正在加载,但不会产生任何错误。

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

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

在html页面中,我有:

代码语言:javascript
复制
</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:

代码语言:javascript
复制
{
 // Required
 "name": "complex",
 "version": "1",
 "manifest_version": 2,
 "plugins": [
 { "path": "npcomplex.dll", "public": true }
 ]
 }
EN

回答 1

Stack Overflow用户

发布于 2012-10-20 23:51:25

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

代码语言:javascript
复制
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."

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12801742

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档