chrome.tabs.executeScript not working?

前端 未结 4 1119
感动是毒
感动是毒 2020-12-03 10:43

I am trying to learn to use the chrome.tabs.executeScript commend. I\'ve created a simple extension with a browser action. My background.html file currently looks like this:

4条回答
  •  温柔的废话
    2020-12-03 11:10

    It's not recommended to use http://*/* and https://*/*. From the Google documentation:

    To inject a programmatic content script, provide the activeTab permission in the manifest. This grants secure access to the active site's host and temporary access to the tabs permission, enabling the content script to run on the current active tab without specifying cross-origin permissions.

    Instead, (as suggested in the page) just use activeTab permission.

提交回复
热议问题