2016-04-06 230 views
1

我们为团队成员创建了一个Chrome扩展,我们希望自己托管它。安装自我托管的Chrome扩展

我知道非网店的安装策略,我觉得我已经正确设置了它,但它不起作用。

以下是我有:

设置我的清单与更新URL像这样的扩展ID键:

{ 
    "update_url": "https://ourownserver.com/extensions/updates.xml", 
    "key":"obljkonioibfihfjbaiidbobmckpkned", 
.... 
} 

我创建updates.xml这样的:

<gupdate xmlns="http://www.google.com/update2/response" protocol="2.0"> 
    <app appid="obljkonioibfihfjbaiidbobmckpkned"> 
     <updatecheck codebase="some-extension.crx" version="3.6"/> 
    </app> 
</gupdate> 

我用chrome://extensions打包.crx和.pem文件,并将它们全部删除为https://ourownserver.com/extensions/,如下所示:

;

我使用注册表编辑器添加ExtensionInstallWhitelistExtensionInstallSourcesHKEY_LOCAL_MACHINE下如下:

enter image description here

enter image description here

我再关闭浏览器并重新打开它

后做所有这一切,我希望这会发生https://ourownserver.com/extensions/extensionName.crx将安装该扩展并且它将被启用。但是,如果我去https://ourownserver.com/extensions/extensionName.crx我仍然得到:

enter image description here

而且扩展选项卡上,它已安装,但禁用,有这样一条消息:

enter image description here

即时通讯思想,我有不正确添加注册表项,但我无法找到更详细的演练。

我在做什么错在这里?

+1

在您的updates.xml中,您是否曾尝试在codebase =“bookit-feedback.crx”中放入完整路径给您的扩展名。即https://ourownserver.com/extensions/bookit-feedback.crx(或者它曾经托管的地方),而不仅仅是bookit-feedback.crx? – dan

+0

@ dan75谢谢,就是这么做的。我不会认为这对初始安装很重要,但确实,在'updates.xml'中使用绝对路径修复了这个问题。如果你抛出一个答案,我会接受它:),再次感谢 – DelightedD0D

+0

没问题,很高兴它的工作。 – dan

回答

2

您的更新XML需要包含扩展CRX的绝对路径,而不是相对路径。例如:

<gupdate xmlns="http://www.google.com/update2/response" protocol="2.0"> 
    <app appid="obljkonioibfihfjbaiidbobmckpkned"> 
     <updatecheck codebase="https://ourownserver.com/extensions/some-extension.crx" version="3.6"/> 
    </app> 
</gupdate> 
+0

今天我发现的其他东西,“* referrer *”必须位于ExtensionInstallSources列表中,我的意思是说你不能简单地在地址栏中放置https:// ourownserver.com/extensions/some-extension.crx,你必须在'https:// ourownserver.com'的某处指向'https:// ourownserver.com/extensions/some-extension.crx'并让用户真正点击那个链接,请求**来自https://ourownserver.com**。昨天晚上,我把头发拉出了一小时,在那个小细节上 – DelightedD0D