javascript - Event when chrome popup is closed -
I need to hear the chrome popup closure event. :
background.js
var port = chrome.runtime listen to on disconnected
event as a suggestion Tried. Connect ({name: "hello"}); Port.onDisconnect.addListener (function () {console.log ("disconnected");});
However, whenever I close it, even when I open the popup, I get disconnected
does anyone know why this is happening Used to be?
solution:
AddEventListener ("unload", function (event ) {DoSomethingInPopup ();}, true);
Comments
Post a Comment