I\'ve already tried window.unload, window.beforeunload, etc. I\'m looking for a way to notify my background page once the popup is closed.
There is currently no way to figure out when the browser action popup was
closed as window.unonload
is triggered immediately when the popup finished
loading, not when it's closed. There is a bug crbug.com/31262 for this.
Three work arounds available are well described here. They include the port.onDisconnect
trick and periodically polling chrome.extension.getViews()
from either the popup or a background page.