如何更改网站内容使用Chrome扩展程序? (例) [英] how to change sites contents Using Chrome Extension ? (Example)
问题描述
我需要一个页面操作或浏览带有改变网站元素的文件的操作
: http://code.google.com/chrome/extensions/content_scripts.html
您可以将JavaScript脚本和CSS样式表添加到页面以更改内容。
祝你好运!
更改www.google.com背景的示例:
您使用以下内容创建.css文件:
body {
background-color:black;
}
制作.css文件时,将其添加到manifest.json中:
content_scripts:[
{
matches:[http://www.google .com / *],
css:[[name] .css]
}
],
匹配意味着它将被添加到任何以 http: //www.google.com/ 因为*。
I Need A Page Action Or Browse Action with Files That Change An element In A Website
take a look at this: http://code.google.com/chrome/extensions/content_scripts.html
You can add javascript scripts and css stylesheets to a page to change the content.
good luck!
an example to change the background of www.google.com: you create a .css file with:
body{
background-color:black;
}
when you made the .css file, add this to manifest.json:
"content_scripts": [
{
"matches": ["http://www.google.com/*"],
"css": ["[name].css"]
}
],
matches means it will be added to any website that begins with http://www.google.com/ because of the '*'.
这篇关于如何更改网站内容使用Chrome扩展程序? (例)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!