Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto-update in Chrome Extensions

I'm building a Chrome Extension and we published the first version of it recently. We already have a group of users who installed it.

We are now trying to push an update (with bug fixes and new features), but are getting mixed messages from Chrome documentation as it pertains to the user experience for updates. They've mentioned that by default, the updated version will be pushed to the Chrome Web Store, but existing users need to restart their browser for the update to be pushed or manually do to chrome://extensions.

Is there a way to automatically push an update to a user that has already installed our Chrome Extension (without any action required by users)?

We expected the new version to be automatically updated for the existing users. However, when the new version was published, the existing users would still be on the previously version 2-3 days after (without restarting their browser)

We expected the users to automatically access the new version without any action to the browser or extension dashboard.

like image 802
Patrick Monnot Avatar asked Sep 06 '25 21:09

Patrick Monnot


1 Answers

Normally the browser autonomously checks if there are updates every few hours. If I remember correctly every 4 hours.

Therefore it is unlikely that the browser will not receive the update if the browser has been open for several days.

However, if the extension is MV2, if there is a persistent background script and if at least one extension page is currently open in the browser then the update may be stucked until that page\tab is closed.

Once the latter is closed, the extension should receive and install the update at the next browser check.

If your extension falls into this case then you could define a handler for the runtime.onUpdateAvailable event where you force the reload of the extension.

"Is there a way to automatically push an update to a user that has already installed our Chrome Extension (without any action required by users)?"

If by "a user" you mean "some users but not all", then you could think of a system that sends a push message from your backend and manage its reception from a service worker which will run the runtime.requestUpdateCheck method only for the desired user(s).

However, this will imply the implementation of a sort of user registration\authentication in order to recognize it at the moment of the forced update request.

Note that you will not be able to selectively allow some users to upgrade while excluding all others. Basically, with this technique you would speed up the update only for one or a part of your users, so this method (not exactly easy to implement) could be overly redundant.

like image 65
Robbi Avatar answered Sep 11 '25 05:09

Robbi