How to find that a browser has been closed in a Chrome Extension

631 views
Skip to first unread message

Soumil Vavikar

unread,
Apr 3, 2015, 9:55:35 AM4/3/15
to chromium-...@chromium.org
How can I find that the browser is being closed inside a Chrome add-on? I don't want to know when a particular tab is closed. I want to know when the browser is being closed.

The window.onbeforeunload  or window.onuload doesn't help as it runs on tab closure, refresh or on click of back button

iza

unread,
Apr 7, 2015, 6:54:47 PM4/7/15
to chromium-...@chromium.org, soumil....@gmail.com
https://developer.chrome.com/extensions/tabs#event-onRemoved 

chrome.tabs.onRemoved.addListener(function callback)

removeInfo has isWindowClosing: true if a window was closed.

iza

unread,
Apr 7, 2015, 6:56:50 PM4/7/15
to chromium-...@chromium.org, soumil....@gmail.com
Actually there is the more appropriate 

chrome.windows.onRemoved.addListener(function callback)

Reply all
Reply to author
Forward
0 new messages