javascript - On Chrome Extension "popup" open/focus -


how can determine if popup window opened? e.g. clicked on extension (chrome.browseraction), window open , want show loading sign inside popup every time that?

  1. you can register onclicked event listener browseraction.

    chrome.browseraction.onclicked.addlistener(function () {     // want }); 
  2. you can listen window.onload event in popup page.

    window.onload = function() {     // want }; 

Comments