How Chrome updates Extensions?

306 views
Skip to first unread message

thierry....@dashlane.com

unread,
Sep 29, 2020, 4:31:37 AM9/29/20
to Chromium Extensions
Hi,

I am trying to gather information about how Chrome updates extensions.

I have been able to find that by default, it checks every 5 hours for a new version of the extension https://source.chromium.org/chromium/chromium/src/+/master:extensions/common/constants.cc;l=52-53

But does Chrome reloads the Extension with the new version as soon as it has downloaded the update? Does it wait for some conditions to trigger the reloading?

I am not a C++ developer so I find it hard to follow the rest of the code. I have searched online but could not find any explanation.

Thanks for your help.

Thierry

Deco

unread,
Sep 29, 2020, 5:20:58 AM9/29/20
to thierry....@dashlane.com, Chromium Extensions
Hey there, yes your initial theory is correct - Chrome will download the updated ZIP package, and correlate the manifest versions of the updated package to identify if any new permissions are needed, or have been taken away. 

This permission check is in place so that extension maintainers may not stealthily inject broad permissions without user consent via an update. After Chrome has completed it's manifest check, it will then replace the old ZIP package (compiled as a CRX) with the new one in it's place.

Hope that clears things up.

Regards,
Deco

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/6efc952f-42a4-40af-99b4-b83fe990b2a2n%40chromium.org.

thierry....@dashlane.com

unread,
Oct 1, 2020, 4:42:18 AM10/1/20
to Chromium Extensions, decklin...@gmail.com, Chromium Extensions, thierry....@dashlane.com
Thanks for the additional info.

So in theory, there is no perceivable delay between the download of the update, and the reload of the extension in Chrome due to the replaced CRX?
I am wondering if Chrome would delay the reload to avoid disturbing the user.

Deco

unread,
Oct 1, 2020, 4:50:53 AM10/1/20
to thierry....@dashlane.com, Chromium Extensions
In theory, it's designed to have no perceivable in difference to the end user, correct. 

Unless there are any scheduler flags designated with Chrome relating to disk usage activity, it won't delay the update, CRX files are relatively tiny in terms of storage, so they don't take a lot of time to decompress.

Regards,
Deco

Simeon Vincent

unread,
Oct 1, 2020, 4:21:55 PM10/1/20
to Chromium Extensions, thierry....@dashlane.com
I am wondering if Chrome would delay the reload to avoid disturbing the user. - t…@dashlane

Ah, interesting question! The behavior depends on whether or not you're using an event page or a persistent background page and (for persistent extensions) if you have an onUpdateAvailable listener registered. In short, event page & SW extensions update when they are next initialized while persistent background pages are immediately replaced by default.

See chrome.runtime.onUpdateAvailable for the full explanation.

Cheers,

Simeon - @dotproto
Developer Advocate for Chrome Extensions

On Thursday, October 1, 2020 at 1:50:53 AM UTC-7, Deco wrote:
In theory, it's designed to have no perceivable in difference to the end user, correct. 

Unless there are any scheduler flags designated with Chrome relating to disk usage activity, it won't delay the update, CRX files are relatively tiny in terms of storage, so they don't take a lot of time to decompress.

Regards,
Deco

thierry....@dashlane.com

unread,
Oct 2, 2020, 8:33:23 AM10/2/20
to Chromium Extensions, Simeon Vincent
Thanks Simeon!

It's very useful, and completely answer my question.

Andrew Thorp

unread,
Mar 9, 2023, 4:46:19 PM3/9/23
to Chromium Extensions, thierry....@dashlane.com, Simeon Vincent
I'm curious about the nuance between onUpdateAvailable() and requestUpdateCheck(), and what exactly triggers onUpdateAvailable(). I understand that chrome will poll every 5 hours for updates; is that what will trigger an UpdateAvailableEvent or is it triggered with less delay? Whether or not that would be the trigger, is there any delay between the update becoming published on the chrome store and the extension instance getting that event? Is there any period of time where requestUpdateCheck() would return a new update but onUpdateAvailable hasn't fired yet?

Thanks!

cue886

unread,
Mar 9, 2023, 4:51:17 PM3/9/23
to Andrew Thorp, Chromium Extensions, thierry....@dashlane.com, Simeon Vincent
windows@windows com
MOBILE 02 2641 9769
MOBILE 02 2768 6200
MOBILE 0916 444 466
MOBILE 0932-032-864
MOBILE 0983 085 809
行動裝置 0916 444 466
住家 0989 200 544
OTHER 0977 444 425
OTHER 0989 200 544
OTHER 0977 444 425
OTHER 0916 444 466
OTHER 0916 094 192
OTHER 0932 032 864
OTHER 0981 225 057
OTHER 0933 060 675
OTHER 0981 225 057
OTHER 0933 060 675
OTHER 0932 032 864
OTHER 0983 085 809
OTHER 0989 200 544
OTHER 0933 060 675
OTHER 0932 032 864
OTHER 02 2768 6200
OTHER 02 2641 9769
OTHER 02 2577 7444
OTHER 02 2577 6444
HOME 0916 778 708
WORK 0985 524 656
MOBILE 0916 778 708
MAIN 0916 444 466
MAIN 0983 085 809
MOBILE 0916 444 466
HOME +886 3 216 0784
HOME 032-160-784
HOME +886 3 216 0784
OTHER +886 3 216 0784
OTHER 0977 444 425
OTHER 0989 200 544
OTHER 0933 060 675
OTHER 0908 941 333
OTHER 0933 060 675
WORK +886 3 216 0784
MOBILE 0983 085 809
MOBILE +886 80 008 0928
MAIN 0932 032 864
HOME 0932 032 864
WORK 0916 444 466
OTHER 0981 225 057
OTHER 0977 444 425
OTHER 0981 225 057
OTHER 0906 924 504
OTHER 0983 085 809
OTHER 0932 032 864
OTHER 0933 060 675
OTHER 0916 094 192
OTHER 0917 957 630
OTHER 0960 964 174
OTHER 0980 093 207
OTHER 0931 883 310
OTHER 0915 011 079
OTHER 0906 002 924
OTHER 0908 941 333
OTHER 02 2768 6200
OTHER 02 2641 9769
OTHER 02 2577 7444
OTHER 02 2577 6444
OTHER 02 2577 5444
OTHER 02 2577 4444
OTHER 02 2577 3444
OTHER 02 2577 2444
OTHER 02 2577 1444
OTHER 0916 094 192
MOBILE +886 2 2351 5887
MAIN 0989 200 544
行動裝置 0906 002 924
行動裝置 0906 002 964
行動裝置 0906 504 924
行動裝置 0906 778 555
行動裝置 0906 924 504
行動裝置 0906 944 544
行動裝置 0906 991 255
行動裝置 0908 233 903
行動裝置 0908 941 333
行動裝置 0908 941 336
行動裝置 0916 444 466
行動裝置 0928 641 927
行動裝置 0932 032 864
行動裝置 0933 060 675
行動裝置 0960 964 174
行動裝置 0960 991 255
行動裝置 0960 964 174
行動裝置 0977 444 425
行動裝置 0977 444 428
行動裝置 0981 225 057
行動裝置 0983 085 809
行動裝置 0983 085 809
行動裝置 0989 200 544
OTHER Solid...@outlook.com
OTHER ev...@coinimaging.com.tw
HOME 886s...@gmail.com
HOME evan...@yahoo.com
HOME iP...@outloik.com
HOME in...@solidify.online
HOME in...@solidifydesign.onmicrosoft.com
HOME 886s...@gmail.com
HOME jer...@kimo.com
HOME m...@Taiwan.gov.tw
HOME merg...@outlook.com
HOME mh093...@gmail.com
HOME solid...@outlook.com
HOME Sam...@outloik.com
HOME Wiki...@wikipedia.org
HOME con...@solidify.blog
住家 iP...@outloik.com
公司 i...@outloik.com
OTHER SOLI...@0916778708.COM
OTHER in...@solidifydesign.onmicrosoft.com
OTHER ser...@coinimaging.com.tw
OTHER solid...@outlook.com
OTHER hotma...@hotmail.com
OTHER mh093...@gmail.com
OTHER evan...@hotmail.com
OTHER a0989...@gmail.com
OTHER a0933...@gmail.com
OTHER evan...@yahoo.com.tw
OTHER evan...@yahoo.com.tw
OTHER solid...@gmail.com
OTHER con...@solidify.blog
OTHER evan...@yahoo.com.tw
OTHER evan...@yahoo.com.tw
OTHER in...@solidify.online
OTHER eva...@hotmail.com
OTHER skyp...@gmail.com
OTHER evan...@yahoo.com
OTHER 886s...@gmail.com
OTHER evan...@gmail.com
OTHER soli...@gmail.com
OTHER art...@outlook.com
OTHER Ser...@gmail.com
OTHER joa...@gmail.com
OTHER m...@msn.com
OTHER joanne_t...@yahoo.com.tw
OTHER joanne_ts...@yahoo.com
OTHER joanne_t...@yahoo.com
OTHER joanne_t...@yahoo.com
OTHER joanne_t...@gmail.com
OTHER ev...@coinimaging.com.tw
OTHER Outlo...@Outlook.com
OTHER SERV...@SOLIDIFY.ASTOS
OTHER Yaho...@Yahoo.com.hk
OTHER Yaho...@Yahoo.com.jp
OTHER Yaho...@Yahoo.com.cn
OTHER joanne...@gmail.com
OTHER Yaho...@Yahoo.com.tw
OTHER evan...@yahoo.com.tw
OTHER evan...@yahoo.com.tw
OTHER wind...@outlook.com
OTHER wind...@outlook.com
OTHER evan...@yahoo.com.tw
OTHER a0982...@gmail.com
OTHER Soli...@yahoo.com.jp
OTHER Soli...@yahoo.com.hk
OTHER Soli...@yahoo.com.cn
OTHER a0977...@gmail.com
OTHER a0989...@gmail.com
OTHER evan...@yahoo.com.tw
OTHER Soli...@yahoo.com.tw
OTHER Soli...@yahoo.com.us
OTHER wind...@outlook.com
OTHER wind...@outlook.com
OTHER Hi.B...@outlook.com
OTHER Bi...@gmail.com
OTHER Bi...@outlook.com
OTHER Bi...@yahoo.com.tw
OTHER bl...@gmail.com
OTHER bl...@icloud.com
OTHER bl...@outlook.com
OTHER bl...@yahoo.com
OTHER evan...@msn.com
OTHER evan...@outlook.com
OTHER ev...@solidify.tw
OTHER Gmai...@Gmail.com
OTHER Gm...@Gmail.com
OTHER Hi.B...@gmail.com
OTHER hot...@hotmail.com
OTHER i...@outlook.com
OTHER in...@solidify.com.tw
OTHER in...@solidify.tw
OTHER jo...@solidify.tw
OTHER msn...@msn.com
OTHER Out...@Outlook.com
OTHER Ser...@outlook.com
OTHER Ser...@yahoo.com.tw
OTHER sk...@gmail.com
OTHER sk...@skype.com
OTHER soli...@outlook.com
OTHER Soli...@yahoo.com
OTHER Twi...@gmail.com
OTHER win...@outlook.com
OTHER Ya...@Yahoo.com
OTHER Ya...@Yahoo.com.tw
OTHER you...@outlook.com
OTHER soli...@icloud.com
OTHER solid...@gmail.com
OTHER evan...@hotmail.com
OTHER evan...@yahoo.com.tw
OTHER eva...@hotmail.com
HOME des...@yahoo.com.tw
WORK solid...@outlook.com
電子郵件 Soli...@icloud.com
電子郵件 SoLi...@Icloud.CoM
WORK Silid...@gmail.com
HOME merg...@outlook.com
OTHER art...@outlook.com
OTHER art...@outlook.com
OTHER merg...@gmail.com
OTHER cue...@gmail.com
OTHER skyp...@gmail.com
OTHER 886s...@gmail.com
OTHER you...@gmail.com
OTHER evan...@gmail.com
OTHER mh0932...@gmail.com
OTHER a0933...@gmail.com
OTHER a0989...@gmail.com
OTHER a0981...@gmail.com
OTHER a0933...@gmail.com
OTHER evan...@yahoo.com.tw
OTHER evan...@yahoo.com.tw
OTHER evan...@yahoo.com
OTHER solid...@outlook.com
HOME onmicro...@onmicrosoft.com
WORK in...@SolidifyDrsign.onmicrosoft.com
OTHER ser...@SolidifyDrsign.onmicrosoft.com
OTHER ev...@SolidifyDrsign.onmicrosoft.com
OTHER SoLi...@GmaiL.CoM
OTHER SoLiD...@GmaiL.CoM
OTHER Merg...@GmaiL.CoM
OTHER Cue...@GmaiL.CoM
OTHER Skyp...@GmaiL.CoM
OTHER 886S...@GmaiL.CoM
OTHER Lin...@GmaiL.CoM
OTHER Liv...@GmaiL.CoM
OTHER Lif...@GmaiL.CoM
OTHER 886...@GmaiL.CoM
OTHER 886...@GmaiL.CoM
OTHER 886...@GmaiL.CoM
OTHER Gmai...@GmaiL.CoM
OTHER @Gm...@GmaiL.CoM
OTHER @GmaiL.CoM.Gmai...@GmaiL.CoM
OTHER Goo...@GmaiL.CoM
OTHER Twi...@GmaiL.CoM
OTHER You...@GmaiL.CoM
OTHER Face...@GmaiL.CoM
OTHER Micr...@GmaiL.CoM
OTHER SoLiD...@OutLook.cOm
OTHER Gm...@GmaiL.CoM
OTHER SoLi...@OutLook.cOm
OTHER ART...@OutLook.cOm
OTHER i...@OutLook.cOm
OTHER Win...@OutLook.cOm
OTHER Windo...@OutLook.cOm
OTHER Wind...@OutLook.cOm
OTHER Windo...@OutLook.cOm
OTHER Wind...@OutLook.cOm
OTHER Wind...@OutLook.cOm
OTHER Wind...@OutLook.cOm
OTHER Wind...@OutLook.cOm
OTHER Wind...@OutLook.cOm
OTHER Wind...@OutLook.cOm
OTHER Ap...@OutLook.cOm
OTHER Goo...@OutLook.cOm
OTHER OutLo...@OutLook.cOm
OTHER @Out...@OutLook.cOm
OTHER OutLook.cOm.OutLo...@OutLook.cOm
OTHER Evan...@Yahoo.com
OTHER Evan...@Yahoo.com
OTHER Evan...@Yahoo.com
OTHER Evan...@Yahoo.com
OTHER Evan...@Yahoo.com
OTHER Evan...@Yahoo.com
OTHER Evan...@Yahoo.com
OTHER Evan...@Yahoo.com
OTHER Evan...@Yahoo.com
OTHER Evan...@Yahoo.com
OTHER SoLi...@Yahoo.com
OTHER SoLi...@Yahoo.com.tw
OTHER SoLi...@Yahoo.com.jp
OTHER SoLi...@Yahoo.com.us
OTHER SoLi...@Yahoo.com.hk
OTHER SoLi...@Yahoo.com.cn
OTHER Yaho...@Yahoo.com
OTHER Yahoo.com...@Yahoo.com
OTHER Ya...@Yahoo.com
OTHER Evan...@HotmaiL.cOm
OTHER Eva...@HotmaiL.cOm
OTHER Evan...@HotmaiL.cOm
OTHER Evan...@HotmaiL.cOm
OTHER Joan...@HotmaiL.cOm
OTHER Joan...@HotmaiL.cOm
OTHER Hotma...@HotmaiL.cOm
OTHER Hot...@HotmaiL.cOm
OTHER HotmaiL.cOm...@HotmaiL.cOm
OTHER SoLi...@HotmaiL.cOm
OTHER Solid...@HotmaiL.cOm
OTHER Merg...@HotmaiL.cOm
OTHER Cue...@HotmaiL.cOm
OTHER merg...@HotmaiL.cOm
OTHER cue...@HotmaiL.cOm
OTHER Goo...@MsN.cOm
OTHER Ev...@MsN.cOm
OTHER Jo...@MsN.cOm
OTHER Soli...@MsN.cOm
OTHER MsN...@MsN.cOm
OTHER MsN.cOm.MsN...@MsN.cOm
OTHER @M...@MsN.cOm
OTHER m...@MsN.cOm
OTHER cham...@Gmail.com
OTHER e9069...@Gmail.com
OTHER a0916...@Gmail.com
OTHER a0989...@Gmail.com
OTHER a0932...@Gmail.com
OTHER a0981...@Gmail.com
OTHER a0977...@Gmail.com
OTHER a0916...@Gmail.com
OTHER a0932...@Gmail.com
OTHER a0906...@Gmail.com
OTHER a0908...@Gmail.com
OTHER evan...@Gmail.com
OTHER a0960...@Gmail.com
OTHER G...@GARMIN.COM.TW
其他 07e...@gmail.com
其他 1...@gmail.com
其他 1...@lone.com
其他 5011...@gmail.com
其他 881...@gmail.com
其他 8...@17.com
其他 886ch...@gmail.com
其他 886...@gmail.com
其他 Blue...@Bluetooth.com
其他 Blue...@outlook.com
其他 Out...@Outlook.ORG
其他 Wi...@Bluetooth.com
其他 a0916...@gmail.com
其他 a0932...@gmail.com
其他 a0933...@gmail.com
其他 a0977...@gmail.com
其他 a0981...@gmail.com
其他 a0989...@gmail.com
其他 a9320...@gmail.com
其他 a9330...@gmail.com
其他 auth...@gmail.com
其他 authe...@gmail.com
其他 c...@solidify.com
其他 ces2...@gmail.com
其他 champi...@gmail.com
其他 comput...@gmail.com
其他 e9069...@gmail.com
其他 esun...@yahoo.com.tw
其他 esun...@yayoo.com.tw
其他 evan...@hotmail.com
其他 evan.c...@gmail.com
其他 evan...@yahoo.com.tw
其他 eva...@hotmail.com
其他 f1234...@gmail.com
其他 fet...@gmail.com
其他 japan...@gmail.com
其他 lin...@gmail.com
其他 mh0932...@gmail.com
其他 okmic...@gmail.com
其他 out...@outlook.com
其他 to6dr...@gmail.com
Skype iP...@outloik.com
生日 1976/7/5
備註 -----------------------------
Contact Imported:
Name : 中華電信中華電信
Group Membership : * myContacts
Phone 1 - Type : Home
Phone 1 - Value : 032-160-784
Phone 2 - Type : Other
Phone 2 - Value : +88632160784
Organization 1 - Type : unknown
備註 evan...@yahoo.com.tw<HTCData><VIPCall/></HTCData>



從我的 Samsung Galaxy 智慧型手機傳送。

-------- 原始訊息 --------
自: 'Andrew Thorp' via Chromium Extensions <chromium-...@chromium.org>
日期: 2023/3/10 05:46 (GMT+08:00)
至: Chromium Extensions <chromium-...@chromium.org>
主旨: Re: [crx] How Chrome updates Extensions?

cue886

unread,
Mar 9, 2023, 4:53:43 PM3/9/23
to outlook.com, Chromium Extensions, thierry....@dashlane.com, Simeon Vincent

Andrew Thorp

unread,
Mar 9, 2023, 9:06:25 PM3/9/23
to Chromium Extensions, Andrew Thorp, thierry....@dashlane.com, Simeon Vincent

After reading through a number of other posts and some of the source code, I think I understand better now, but I'd like to confirm my understanding. When your update is "published' it becomes available for pulling. Every 5 hours (by default) chrom{e,ium} will poll-for and pull any new updates for extensions. You can call `requestUpdateCheck()` to trigger this step manually. Once the update has been downloaded, regardless of whether it was polled or requested manually, it attempts to install the update. If the background task is persistent, then the update is delayed until the background task restarts, and an UpdateAvailableEvent is dispatched to any handler. If there is a handler assigned to `onUpdateAvailable()` and it resets the background task, that allows chrome to update the extension.

In theory then if you had your extension run `requestUpdateCheck()` at a specific time and handled the `onUpdateAvailable` event, would all your extensions update simultaneously or are there other factors which might lengthen the rollout process?
Reply all
Reply to author
Forward
0 new messages