Is there an event for when a Chrome Extension popup is closed?

前端 未结 4 1808
说谎
说谎 2020-11-29 05:28

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.

4条回答
  •  野性不改
    2020-11-29 05:43

    Probably a hacky way, but in the popup page you can listen to

      window.onblur = function(){}
    

    and send a message to active tab.

提交回复
热议问题