Answer the question
In order to leave comments, you need to log in
How to catch browser close in chrome extension?
Hello gentlemen!
I am writing a chrome extension, this is my first experience.
I have a timer function that runs all the time the browser is open.
Today I discovered one problem: after closing the browser, I soon reopened it, and the timer continued to work.
So, tell me, please, how can I catch the moment the browser closes in my js-file, so that at that moment I can stop executing my function?
Thank you for attention.
Answer the question
In order to leave comments, you need to log in
stackoverflow.com/questions/3390470/event-onbrowse...
chrome.windows.onRemoved.addListener(function(windowId){
alert("!! Exiting the Browser !!");
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question