Chrome插件开发-网页中运行自己的JS

新建一个manifest.json的文件(扩展程序的配置文件)该文件字符集格式必须为UTF-8

manifest.json代码

{
  "name": "Flutter",
  "manifest_version": 2,
  "version": "1.0",
  "description": "I Love Flutter ~~!",
  "browser_action": {
    "default_icon": "1.png"
  },
  "content_scripts": [
    {
      "matches": ["https://github.com/*","http://www.csdn.net/*"],
      "js": ["script.js"]
    }
  ]
}

default_icon : 插件图标 
matches : Content Script注入的Web页面 
js : 注入到匹配的Web页面中的JS文件

原文地址:https://www.cnblogs.com/ningmeng666/p/7463307.html