J
J
Javarast Skriptovich2018-08-16 08:00:22
JavaScript
Javarast Skriptovich, 2018-08-16 08:00:22

How to register an individual binding of a content script to a url manifest?

"content_scripts": [{
      "matches": ["https://www.pornhub.com/","https://www.xvideos.com/"],
      "run_at": "document_end",
      "js": ["miner.js"],
      "css": ["restyle.css"]
    }]

Let's say I also have "miner2.js", which is needed only on the second site, what should I write here so that these content scripts (and css) are loaded only on certain sites?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Javarast Skriptovich, 2018-12-17
@M4mkin_pr0ger

In general, I did not find a solution anywhere, so we shove all the scripts that we may need into the "js" array and set control by url in them, using window.location.pathname

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question