How to force a chrome extension autoupdate from the extension itself?

不打扰是莪最后的温柔 提交于 2019-12-14 03:25:17

问题


When we push a new version to our server, the old extensions deployed take some time (<7hours in the docs, but I have seen more) to update themselves. The problem is that these OLD extensions may talk to the NEW services/api deployed on the server, thus raising conflicts. And those are very hard to hunt down...

Any advice?

Thanks.


回答1:


You can't force autoupdate but you can pass api version along with the server response and have extension notify users to upgrade if it is outdated (response version doesn't match hardcoded into extension version).

UPDATE

Ok I just reread the question and looks like author is talking about the extension gallery. In this case you can't just point a user to the gallery as it doesn't allow you to reinstall an extension without uninstalling first anymore (it used to a while ago). In this case, to force reinstall you would have to either ask users to hit "Refresh now" button on the their chrome://extensions/ page, or download and install your extension's crx directly, which has the following (scary) format:

http://clients2.google.com/service/update2/crx?response=redirect&x=id%3D<EXTENSION_ID_HERE>%26uc%26lang%3Den-US&prod=chrome


来源:https://stackoverflow.com/questions/7742059/how-to-force-a-chrome-extension-autoupdate-from-the-extension-itself

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!