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

后端 未结 6 1836
南旧
南旧 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 09:14

    I solved this problem by checking the title of the tab when updated:

    chrome.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) {
    
    var title = changeInfo.title;
        if (title !== undefined) {
           doSomething();
        }
    });
    

提交回复
热议问题