如何更改网站内容使用Chrome扩展程序? (例) [英] how to change sites contents Using Chrome Extension ? (Example)

查看:215
本文介绍了如何更改网站内容使用Chrome扩展程序? (例)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个页面操作或浏览带有改变网站元素的文件的操作

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆