MV3: chrome.action.setIcon makes a request everytime It's called

154 views
Skip to first unread message

Oluwatomi Alagbe

unread,
Aug 30, 2024, 9:59:36 AMAug 30
to Chromium Extensions, dl-brow...@malwarebytes.com
Hello. 

I'm an engineer on the Malwarebytes browserguard team. 
We recently migrated our extension to MV3 and we noticed that everytime we make a call to the chrome.action.setIcon API we see a corresponding network request for the Icon in the Network tab of the developer tools. This is not the case in MV2. 

Is this a bug? Are there any performance consequences of this that we need to be worried about?

Best regards.

woxxom

unread,
Aug 30, 2024, 11:52:57 AMAug 30
to Chromium Extensions, Oluwatomi Alagbe, dl-brow...@malwarebytes.com
If you change the icon a lot e.g. for each tab, consider caching imageData from Canvas/OffscreenCanvas yourself, because Chrome doesn't cache it and re-reads the icon file each time for each time for each specified icon size, both in MV2 and MV3.

Oluwatomi Alagbe

unread,
Sep 2, 2024, 4:09:47 AMSep 2
to Chromium Extensions, woxxom, Oluwatomi Alagbe, dl-brow...@malwarebytes.com
Thanks for the tip
Reply all
Reply to author
Forward
0 new messages