如何从扩展本身强制扩展chrome扩展autoupdate? [英] How to force a chrome extension autoupdate from the extension itself?

查看:295
本文介绍了如何从扩展本身强制扩展chrome扩展autoupdate?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们将新版本推送到我们的服务器时,部署的旧扩展需要一些时间(文档中小于7小时,但我已经看到更多)来更新自己。问题是这些OLD扩展可能会与服务器上部署的NEW服务/ API关联,从而引发冲突。这些都很难追捕...



有什么建议吗?



谢谢。

解决方案

您无法强制autoupdate,但您可以将api版本与服务器响应一起传递,并且如果延迟通知用户升级(响应版本不匹配硬编码为扩展版本),则会通知用户进行升级。

更新



好的,我刚刚重读了这个问题,看起来作者正在谈论扩展库。在这种情况下,您不能只将用户指向图库,因为它不允许您在不首先卸载的情况下重新安装扩展程序(以前使用过)。在这种情况下,要强制重新安装,您必须要求用户在其 chrome:// extensions / 页面上点击立即刷新按钮,或者下载并安装您的扩展的crx直接,它有以下(吓人)的格式:

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


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.

解决方案

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

这篇关于如何从扩展本身强制扩展chrome扩展autoupdate?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆