I have a Firefox extension where I want to apply contentScript.js
to all web pages. The manifest.json
looks like this:
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*"],
"css": ["background.css"],
"js":["contentScript.js"]
}
]
However, I only want the CSS to be applied to a certain web page. Right now the CSS is applied to all web pages.
How can I solve this?
CodePudding user response:
My friend came up with a solution, change your manifest file to this:
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*"],
"js":["contentScript.js"]
},
{
"matches": ["*://*.website.org/*"],
"css": ["background.css"]
}
]
Life saver.