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.
Probably a hacky way, but in the popup page you can listen to
window.onblur = function(){}
and send a message to active tab.