How to specify which content scripts which will run on all_frames and which won't?

后端 未结 1 743
说谎
说谎 2021-01-23 11:03

When specifying parameters in the manifest file of a chrome extension there is an option all_frames. This allows the content scripts to be embedded in all frames of

相关标签:
1条回答
  • 2021-01-23 11:28

    The content_scripts manifest property is an array, so you can define multiple content script specification objects:

    "content_scripts": [
        {
          "matches": ["http://www.google.com/*"],
          "css": ["mystyles.css"],
          "js": ["a.js"],
          "all_frames": false
        },
    
        {
          "matches": ["http://www.yahoo.com/*"],
          "js": ["b.js"],
          "all_frames": true
        }
    ],
    
    0 讨论(0)
提交回复
热议问题