Chrome extension's original page is inactive makes the extension work on 2 clicks

I have an extension that runs on a background image, the browserAction icon needs 2 clicks in max. a few seconds for the extension to get the background.js running, so I tried to figure out what the problem is: with the chrome: // extensions page loaded, which points to my extension: The background page is inactive. When I click once, the state changes to the main page and then the next click actually launches the extension, I couldn't figure out what the problem is, I am using chrome.runtime.reload()

in multiple places, maybe the problem, but what is the solution? thanks in advance


source to share

1 answer

A background page can become inactive if it is declared as a page.

Which probably means you haven't configured it correctly if events are only handled after they have been called twice.

Obvious solution: remove "persistent": false

from manifest.

Correct solution: see if your background script can create a proper event page . p>



All Articles