Answer the question
In order to leave comments, you need to log in
How to detect extension popup is closed in Chrome?
window.onclose doesn't help.
When you click on the extension button, a window is created. And then, when it closes, the link to it remains! Function references remain in it and are called without problems from the background page! Events inside popup (including setInterval) remain and fire!
(In FireFox, this is easier - there the popup dies immediately and all links become "dead" and cause an error when used).
How to understand that popup is hidden? The problem is only in Chrome.
Answer the question
In order to leave comments, you need to log in
If you need to store a link to a popup, then the architecture of your extension is sad.
Use chrome.runtime.onMessage / chrome.runtime.sendMessage
or
https://developer.mozilla.org/en-US/docs/Web/API/B...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question