kirqe
kirqe

Reputation: 2470

How to make chrome extension work on all domain zones of specific site?

I have a tiny chrome extension that works on google translate com How can I make it working on all domain zones(not only .com)?

Tried the following but it doesn't seem to work. "matches": [ "*://translate.google.*/*" ],

Error
Invalid value for 'content_scripts[0].matches[0]': Invalid host wildcard.

This is not a duplicate of Chrome extension: Run on all google domains and a specific page I want it to work only on translate page.

  "matches": [ "*://*/*" ],
  "include_globs": [
    "*://translate.google.*/*"
  ]

This part makes it working on google.com search page. I don't need this.

Upvotes: 1

Views: 731

Answers (1)

kirqe
kirqe

Reputation: 2470

Thanks to @wOxxOm

  1. Go to http://www.google.com/supported_domains
  2. Open console and paste the following:
copy(document.body.innerText.split(" ").map((item) => { return `*://translate${item}/*` }))
  1. Go to your manifest file and replace matches": [] array with what you've just copied.

Upvotes: 1

Related Questions