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

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -