chrome.tabs returns undefined in content script

后端 未结 4 1495

chrome.tabs returns undefined despite the fact I set tabs in the permissions block.

\"permissions\": [
    \"tabs\",
    \"http://*/*\",
    \"h         


        
4条回答
  •  执念已碎
    2020-11-22 15:12

    Check this answer also https://stackoverflow.com/a/6718277/449345 This one worked for me

    chrome.tabs.getSelected(null, function(tab){
        console.log(tab);
    });
    

提交回复
热议问题