When a chrome app window is closed, is it possible to detect the event? and do an action before the window is closed?
相关问题
- How does same-domain policy apply to background sc
- YouTube Data API v3 allowed referers for browser a
- Chrome Extension: How can I get global settings in
- Keep receiving Login Required error when trying to
- chrome.runtime.reload blocking the extension
相关文章
- Progressive web app(PWA) vs Electron vs Browser ex
- chrome.runtime.getURL vs. chrome.extension.getURL
- Will this hotkey work for Mac users?
- Chrome extension permission for “about:blank” page
- getElementById not working in Google Chrome extens
- Google Chrome extension: How to find out if a user
- How can my Chrome plugin disable itself via Javasc
- How to package Firefox and Chrome extensions
chrome.app.window.current().onClosed allows you to register an event listener for when a window is closed.
Vincent's answer will work in some cases, but the documentation warns that some chrome api functionality will be lost by the time the onClosed event is fired.
To listen for this event from the background page, do something like this: