1

I am making a chrome extension and I have am having difficulty finding out how to make my content.js run on the pages I want.

My manifest.json have this:

"content_scripts": [{
    "js": ["content.js"],
    "matches": ["https://www.example.com/*"]
}]

Now I know this will allow https://www.example.com/(any_path) to run the content.js, however, I am trying to make it so that it will run on https://www.example.com.*, for instance I want the extension to work on https://www.example.com.au and https://www.example.com.uk etc. Is there anyway to do this?

I have tried doing this in my manifest.js, but it doesn't seem to work:

"content_scripts": [{
    "js": ["content.js"],
    "matches": ["https://www.example.com.*"]
}]

Any suggestions are appreciated.

Thanks

Nick Parsons
  • 45,728
  • 6
  • 46
  • 64
  • 1
    Yeah, TLD in `matches` can't be `*`, use [include_globs](https://developer.chrome.com/extensions/content_scripts). See [How to load a content script on all Google (international) pages?](//stackoverflow.com/a/16187588) – wOxxOm Feb 24 '17 at 11:38
  • @wOxxOm Ok, thanks I'll take a look at that – Nick Parsons Feb 24 '17 at 11:46

0 Answers0