Tell me how to change the css page on which the user is located using the chrome extension?
2 answers
To modify page styles, an extension consisting of two files is sufficient:
mainfest.json (it describes the extension itself and indicates the pages on which the extension should work):
{ "manifest_version": 2, "name": "Sample content script", "version": "0.0.0", "content_scripts": [ { "matches": [ "*://*.stackoverflow.com/*", "*://stackoverflow.com/*" ], "css": [ "my.css" ] } ] } The my.css file (specified in the manifest) defines the styles that should be applied on the page:
#nav-questions { background-color: red; } This example makes the background of the "questions" link, on this site at the top of the page, red.
|
For example: $("class/id").css("display", "none");
- requested "chrome extension". And jQuery extensions are usually not available in chrome extensions, so the
$()function is not there - Mike - I wrote this because there is a jQuery label - Andrew Kasyanov
- Yes, this is the author of the question got excited. on the other hand, a lot of people confuse javascript initial and jquery and mold tags for the company - Mike
- @Mike, isn't it possible to shove
jQuerythrough Content Scripts in the "chrome extension"? - Puvvl - one@Puvvl possible. That's why I said "usually not available", and not "it is not there and can not be." Just dragging a whole jQuery for the sake of changing a couple of styles, an extension is not the best idea. - Mike
|