Addon only works on localhost

(Inamfdserv) #1

this is a very simple addon



  "manifest_version": 2,
  "name": "Borderify",
  "version": "1.0",

  "description": "Adds a red border to all webpages matching",

  "icons": {
    "48": "icons/border-48.png"

  "content_scripts": [
      "matches": ["*://*.localhost/*"],
      "js": ["app.js"]


app.js = "red";
document.getElementById('foot').innerHTML = 'hi';

this works fine when i open localhost but when i change

      "matches": ["*://*.localhost/*"],


      "matches": ["*://*.stackoverflow/*"],

it wouldn’t work anymore when i open

(Niklas Gollenstede) #2

Well, if you want it to work on, you should use that domain in the match pattern ("matches": ["*://**"]).

(Inamfdserv) #3

thanx , i thought using wild card doesnt need the full domain

(Niklas Gollenstede) #4

Nope. The wildcards in this pattern mean:

  • any protocol (http/https)
  • any subdomain (such as `www.) or no subdomain
  • any path/query/hash

You always have to specify the complete public suffix (TLD + the sprecific domain name in that TLD) (or wildcard to all domains).