'how to match both https and http in matches (manifest.json)

At the moment I've got it like this:

"matches": ['https://google.com/*', 'http://google.com/*']

Is there any way to combine these 2 URLs into one allowing both https and http?

(Manifest V3)



Solution 1:[1]

  1. * is for both http and https.

  2. The real address of google.com is www.google.com (Chrome hides the www part by default)

  3. Use double quotes.

"matches": ["*://www.google.com/*"]

Solution 2:[2]

According to https://developer.chrome.com/docs/extensions/mv2/match_patterns/ you could do:

"matches": ["*://google.com/*"]

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 wOxxOm
Solution 2 JorgeObregon