1

i'm in the painful process of migrating my extension from manifest v2 to v3, and among the many issues i have to solve actually i can't find a solution to this one.

Basically in my manifest v2 had a background page with the following line of code:

chrome.pageAction.show(tabId);

But now in manifest v3 pageAction and browserAction are no longer available, and the .show() method in the new .action object is not available. When i try to load the extension i get the following error:

 in event handler: TypeError: chrome.action.show is not a function
    at chrome-extension://ilffkamoglijakcakajaackcckakgddi/src/background.js:31:25
background.js:26 

I tried to look around in the v3 docuentation, but i failed to find a solution to my problem, how am i supposed to replace the .show() method?

Ivan
  • 4,186
  • 5
  • 39
  • 72
  • You'll have to set a different icon I guess. See also [this example](https://stackoverflow.com/a/64475504). – wOxxOm Jan 09 '22 at 13:21
  • not sure why? if my plan is to refresh a page why i should set a different icon? – Ivan Jan 31 '22 at 01:01
  • Because there's no page action anymore in MV3, you can only change the icon itself. – wOxxOm Jan 31 '22 at 01:10
  • yeah i know that the pageAction is removed from manifest v3, but i was hopign there was a better candidate... i was looking at few examples (not even sure if they will solve my issue) but basically 2 lines of code now must be replaced with something like 15/20 lines of code (and is not the first time with this migration that it happens... very frustrating!) – Ivan Jan 31 '22 at 01:15

0 Answers0