-1


我想在我的 asp.net 服务器上托管我自己的扩展程序(它是免费的网络服务器,所以我无权访问 machine.config 等)。
但我的问题的重点就在这里。我把打包的扩展放到服务器上,我想使用这样的东西:

protected void Page_Load(object sender, EventArgs e)
    {
        string file = Request.QueryString["f"];
        if (file != null)
        {            
            Response.Write("");
            if (file == "0")
            {
                Response.ContentType = "application/x-chrome-extension";
                Response.AddHeader("Content-Disposition", "attachment;filename=RemotePlay_extension.crx");
                Response.TransmitFile("~/Extensions/Update/RemotePlay_extension.crx");
            }
            else
            {
                Response.ContentType = "application/x-chrome-extension";
                Response.AddHeader("Content-Disposition", "attachment;filename=RemotePlay_extension.crx");
                Response.TransmitFile("~/Extensions/RemotePlay_extension.crx");
            }
        }
    }

但每次我得到这个错误:
下载扩展程序后出现错误:包无效:'CRX_SIGNATURE_VERIFICATION_FAILED'


扩展清单的来源:

{
 "name": "Remote Play",
 "description": "DJ interface to use RP.",
 "version": "0.0.0.2",
 "update_url": "../Extensions/RemoteChrome_Update.xml",
 "permissions": ["tabs", "http://*/*"],
 "background": { "scripts": ["background.js"] },
 "content_scripts": [{"matches": ["http://*/*"],"js": ["inject.js"]}],
 "page_action": {"default_icon": "playico.png", "default_popup": "popup.html"},
 "manifest_version": 2
}

我做错了什么?那个错误在哪里?

4

1 回答 1

1

您不能通过Page_Load函数和标题触发安装

  • 你应该有一个链接标签<link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/apdfllckaahabafndbhieahigkjlhalf">
  • 您可以通过触发安装chrome.webstore.install(url, successCallback, failureCallback)

有关更多信息,请查看文档

于 2013-01-29T08:44:26.703 回答