I want to add a little something to my chrome extension. What I want to do, is everytime I click in an input field in chr开发者_开发知识库ome I want the color (background) to change, Only for that period of viewing the page. I only want to do this when my extension is turned on.
how can I do this?
If you know how to do it in javascript then converting it into an extension is very easy.
You need two files:
- Your js file where you do all the work (exactly as if you did it on a regular page). This is called a "content script".
Manifest file where you describe on which domains your content script should run:
{ "name": "My extension", ... "content_scripts": [ { "matches": ["http://www.google.com/*"], "css": ["mystyles.css"], "js": ["jquery.js", "myscript.js"] } ], ... }
You can read more about content scripts here and about extension structure in general here.
精彩评论