Possible Duplicate:
My CSS is not getting injected through my content script
I’ve been trying to make a Chrome Extension to change the background color of google to black every time it’s loaded in a tab.
I have the following in my manifest.json:
{
"name": "Background to black",
"manifest_version": 2,
"version": "1.0",
"description": "Google black",
"permissions": ["tabs", "http://www.google.com/*"],
"browser_action": {
"default_icon": "icon.png"
},
"content_scripts": [
{
"matches": ["http://www.google.com/*"],
"css": ["backgroundtoblack.css"],
"run_at": "document_start",
"all_frames": true
}
]
}
and this in my backgroundtoblack.css:
body{
background: #000000;
}
However it doesn’t work for me and I don’t understand what I’m doing wrong.
This isn’t about the manifest file, it’s about your CSS file. Replacing your CSS with this,
The extension should work now. (Works when testing locally).
Note: I had to change your
matchesa bit, because I use HTTPS Everywhere. You might have to change it if Chrome is loading using HTTPS by default.