chrome.tabs returns undefined in content script

后端 未结 4 1501

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

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


        
4条回答
  •  一向
    一向 (楼主)
    2020-11-22 15:13

    As content script has its own limitations,

    chrome.tabs is only available in background scripts and popup scripts.

    If you wanna to use chrome.tabs then pass message from content_script to background script and play with chrome.tabs.

提交回复
热议问题