Chrome浏览器插件开发(一)

官网: https://developer.chrome.com/docs/extensions/mv3/

参考官网例子,巨详细

新建文件 manifest.json

{
  "manifest_version": 3,
  "name": "Hello Extensions",
  "description": "Base Level Extension",
  "version": "1.0",
  "action": {
    "default_popup": "hello.html",
    "default_icon": "hello_extensions.png"
  }
}

新建hello.html,代码如下

<html>
  <body>
    <h1>Hello Extensions</h1>
    <script src="popup.js"></script>
  </body>
</html>

新建popup.js文件,代码如下

console.log("This is a popup!")

看效果

image-20221122191627442

posted @ 2022-11-22 22:50  进阶的蜗牛  阅读(97)  评论(0编辑  收藏  举报