Limit Chrome Extension to certain URLs?

前端 未结 3 1233
失恋的感觉
失恋的感觉 2020-12-31 02:41

Is there a way to limit a Chrome extension to only run on certain urls?

Say I want the extension to run only if the domain is Amazon.com. I realize you can put a che

3条回答
  •  一个人的身影
    2020-12-31 03:09

    Welp, it figures I would find the answer to this right after posting the question, even though I have been stuck for a while...

    http://code.google.com/chrome/extensions/content_scripts.html

    In manifest.json:

    "content_scripts": [
        {
          "matches": [...urls...],
          "exclude_matches": [...urls...],
          "css": [...]
        }
    ]
    

提交回复
热议问题