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

Popular posts from this blog

php - Select box validation (in laravel) -

pandas - Iterate on Groupby Object's fields -

javascript - Render HTML after each iteration in loop -