A
A
Andrey2014-11-17 23:09:45
JavaScript
Andrey, 2014-11-17 23:09:45

How to create an extension for Google chrome that replaces css file?

How to create an extension that adds css to a site, one specific site. I can't find any examples on google. In similar extensions, I looked at background js, there you can’t really figure out why the script decides that it is on the right page, and the manifest is not available. Tell me how this is done, I have experience in small extensions, but I can’t imagine how to solve this problem.
Poglazev on https://developer.chrome.com/extensions/content_scripts , caught up with how to insert css, giving the rights to the site I need, he changes css on all sites, what am I doing wrong?
So far, it is solved by creating very individual sets of classes, but are there any other ways out?)) This should still work not so crutch

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis, 2014-11-18
@Anderi6299E

In manifest.json:

"content_scripts": [{
        "matches": ["ваш-урл-или-*-маска"],
        "js": ["contentscript-min.js"]
    }]

I
Ilya Korablev, 2014-11-24
@swipeshot

As I understand it correctly... there is a Stylish extension

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question