how to change sites contents Using Chrome Extension ? (Example) [closed]

余生颓废 提交于 2019-12-14 03:35:31

问题


I Need A Page Action Or Browse Action with Files That Change An element In A Website


回答1:


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 '*'.



来源:https://stackoverflow.com/questions/11666449/how-to-change-sites-contents-using-chrome-extension-example

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!