我想在我的asp.net服务器上托管我自己的扩展(它是免费的Web服务器,所以我没有访问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");
}
}
}
但每次我收到此错误:
扩展来源清单:
{
"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
}
我做错了什么?那个错误在哪里?
答案 0 :(得分:1)
您无法通过Page_Load
功能和标题
<link rel="chrome-webstore-item"
href="https://chrome.google.com/webstore/detail/apdfllckaahabafndbhieahigkjlhalf">
chrome.webstore.install(url, successCallback, failureCallback)
有关详细信息,请查看documentation。