本文介绍了为什么打包的chrome扩展程序无法更新?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新:解决了一部分,但没有解决

  1. 我现在正在更新CRX(尚未重建).

  1. I have the CRX updating now (it was not rebuilding).

但是,Chrome不会通过https URL接受XML或CRX.

However, Chrome will not accept the XML or CRX at an https URL.

我认为#2是因为它是一个自签名证书.有人知道这是否有办法吗?(这纯粹是为了开发,所以在内部托管)

I believe #2 is because it's a self-signed certificate. Does anyone know if there's a way around this? (This is purely for development, so hosted internally)

原始帖子:

我创建了一个打包的扩展程序,该打包的扩展程序托管在我的内部网站上,但是通过从桌面上拖动将其添加到Chrome中(因为Chrome不允许通过外部网站安装打包的扩展程序-参见此处:).

I created a packaged extension that is hosted on my internal website, but is added to Chrome via dragging it from the desktop (because Chrome won't allow installing packaged extensions via external websites - see here: After adding ExtensionInstallSources preference with my URL to Chrome Preferences, still won't allow installing ".crx" packaged app ).

清单的 update_url 设置为位于我网站上的XML文件.该XML文件的crx文件的URL在 updatecheck codebase ='...'下设置.这两个文件都存在于网站上,并且可以找到.我还将XML文件和 manifest.json 中的版本号从 2.0.0.2 升级到了 2.0.0.2 .我还对扩展名的index.html文件进行了更改.

The manifest has the update_url set to an XML file located on my site. That XML file has the url for the crx file set under updatecheck codebase='...'. Both files exist on the website and are findable. I also upated the version number from 2.0.0.2 to 2.0.0.2 in both the XML file and the manifest.json. I also made a change in the index.html file of the extension.

我检查了 appid ,并且在XML文件和Chrome中相同.

I checked the appid and it is the same in the XML file and in Chrome.

尽管单击立即更新扩展"按钮约50次,并等待10分钟,但它不会更新.

Despite clicking the "update extensions now" button about 50 times, and waiting 10 minutes, it does not update.

注意:我对内部IP 192.168.1.108做了别名,该站点在我的主机文件中托管为 myinternal.fake ,但这在chrome和firefox中都有效,所以我不能认为这是问题所在

NOTE: I did alias the internal ip 192.168.1.108 where the site is hosted in my hosts file as myinternal.fake but this works in both chrome and firefox so I don't think that's the issue

更新XML文件(位于: https://myinternal.fake/updates/helloworld.xml )

Update XML File (located at: https://myinternal.fake/updates/helloworld.xml)

<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
    <app appid='akchdaojnpiglpjeiamjpacbkppcgbgj'>
        <updatecheck codebase='https://myinternal.fake/helloworld.crx' version='2.0.0.2' prodversionmin='23' />
    </app>
</gupdate>

manifest.json

{
    "manifest_version": 2,
    "name": "Hello World",
    "version": "2.0.0.2",
    "minimum_chrome_version": "23",
    "update_url": "https://myinternal.fake/updates/helloworld.xml",
    "icons":
    {
        "16": "icon_16.png",
        "128": "icon_128.png"
    },
    "app":
    {
        "background":
        {
            "scripts":
            [
                "main.js"
            ]
        }
    }
}

我也检查了一下,并且标题是Chrome可接受的标题(根据此内容: http://developer.chrome.com/dev/extensions/hosting.html ).它以文本/纯文本"形式发送CRX文件,而不发送标头 X-Content-Type-Options:nosniff ,因此它应该是有效的.

I also checked and the header is an acceptable one for Chrome (according to this: http://developer.chrome.com/dev/extensions/hosting.html). It sends the CRX file as "text/plain" and does NOT send the header X-Content-Type-Options: nosniff so it should be valid.

此外,当我从 https 更改为 http 时,现在单击立即更新扩展名"时,扩展名消失了片刻,这表明它正在读取XML.,但仍然不接受更新!

Also, when I changed from https to http, now when I click "update extensions now" the extension disappears for a split second which indicates it's now reading the XML, but still not accepting the update!

推荐答案

此问题与自签名证书和Chrome有关.Chrome不会接受自签名证书形式的扩展程序更新,除非它们是接受的"授权.这些步骤将使其起作用:

The issue is with self-signed certificates and Chrome. Chrome does not accept Extension updates form self-signed certificates unless they're an "accepted" authority. These steps will make it work:

  1. 请按照以下步骤操作: https://stackoverflow.com/a/15076602/857025 导出您的证书,然后将其作为授权导入

  1. Follow these steps: https://stackoverflow.com/a/15076602/857025 to export your certificate and then import it as an authority

关闭Chrome

重新启动Chrome

Restart Chrome

关闭扩展程序窗口(如果已打开)

Close extensions window if opened

通过"chrome://extensions"重新打开,然后单击立即更新扩展名"

Reopen via "chrome://extensions" and then click "update extensions now"

然后它将更新位于自签名https连接上的扩展名.

It should then update your extension located on a self-signed https connection.

更新这不是一个完美的解决方案,因为Chrome似乎在接受自签名证书方面有点不灵活.它随机停止查看更新.如果我切换回使用常规http(用于update_url和CRX的URL),则每次都会进行更新.

UPDATE This is not a perfect solution as Chrome appears to be a bit wonky in accepting self-signed certs. It randomly stops seeing updates. If I switch back to using regular http (for the update_url and the CRX's url), updates happen every time.

我检查了一下,但我的证书仍然是受信任的颁发机构,但是Chrome突然停止了识别更新,因此必定有问题.

I checked and my cert is still a trusted authority but Chrome suddenly stopped recognizing updates, so there must be an issue with this.

这篇关于为什么打包的chrome扩展程序无法更新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 02:17