[removed] not working in chrome

后端 未结 9 861
遥遥无期
遥遥无期 2020-11-27 07:25

This is the code which i used for window.onbeforeunload......




        
9条回答
  •  无人及你
    2020-11-27 08:17

    None of the above worked for me. I was sending a message from the content script -> background script in the before unload event function. What did work was when I set persistent to true (in fact you can just remove the line altogether) in the manifest:

    "background": {
        "scripts": [
            "background.js"
        ],
        "persistent": true
      },
    

    The logic is explained at this SO question here.

提交回复
热议问题