Get the urls of all the tabs in all windows using chrome extension

后端 未结 2 662
暗喜
暗喜 2020-12-13 15:20

Is this possible for chrome extension to get all the URLs in all tabs using chrome extension ?

I have got the url of current Tab using this code

chro         


        
2条回答
  •  不知归路
    2020-12-13 15:34

    You could do something like this:

    chrome.windows.getAll({populate:true},function(windows){
      windows.forEach(function(window){
        window.tabs.forEach(function(tab){
          //collect all of the urls here, I will just log them instead
          console.log(tab.url);
        });
      });
    });
    

提交回复
热议问题