Chrome extension, [removed] Why is this firing twice?

后端 未结 6 1824
南旧
南旧 2020-12-29 08:15

I have a very very simple bit of code in my (test) Chrome extension:

    function test()
    {
    alert(\"In test!\");
    }

   chrome.tabs.onUpdated.addLi         


        
6条回答
  •  不思量自难忘°
    2020-12-29 08:57

    I was also confused by this and tried to find the answer. Only after some experimentation did I figure out why I was receiving multiple "complete" update events for what I thought was a single page "update".

    If your page has iframes, each will trigger a "complete" event and bubble up to the parent content script. So more complex pages will trigger a slew of onUpdated events if they have iframes.

提交回复
热议问题