Question

I'm trying to get a Chrome Extension for a site which redirects www.site.com to site.com

This manifest file works.

{
"name" : "MySite Redesign",
"version": "0.1",
"manifest_version": 2,
"description" : "Improves MySite visual design to make the interface cleaner.",
"content_scripts" : [{
    "matches" : ["*://www.mysite.com/*"],
    "css" : ["style.css"]
  }]
}

This does not

{
"name" : "MySite Redesign",
"version": "0.1",
"manifest_version": 2,
"description" : "Improves MySite visual design to make the interface cleaner.",
"content_scripts" : [{
    "matches" : ["mysite.com/*"],
    "css" : ["style.css"]
  }]
}

The error reads:

"Could not load extension from '/Users/colmtuite/dev/mysite-extension'. Invalid value for 'content_scripts[0].matches[0]': Missing scheme separator."

Was it helpful?

Solution

According to the "Match Patterns" docs it's mandatory to specify a scheme. You can use * to mean "any scheme", "any subdomain" and "any path":

*://*.mysite.com/*
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top