开源项目教程:tosdr/browser-extensions

开源项目教程:tosdr/browser-extensions

browser-extensionsBrowser extensions for Terms of Service; Didn't Read. “I have read and agree to the Terms” is the biggest lie on the web. We aim to fix that. Get informed instantly about websites' terms & privacy policies, with ratings and summaries from the www.tosdr.org initiative. 项目地址:https://gitcode.com/gh_mirrors/br/browser-extensions

1. 项目的目录结构及介绍

tosdr/browser-extensions/
├── _locales/
│   ├── en/
│   │   └── messages.json
│   └── fr/
│       └── messages.json
├── assets/
│   ├── icons/
│   └── images/
├── src/
│   ├── background/
│   ├── content/
│   ├── popup/
│   └── options/
├── .gitignore
├── LICENSE
├── README.md
├── manifest.json
└── package.json
  • _locales/: 包含不同语言的本地化文件。
  • assets/: 存放项目的静态资源,如图标和图片。
  • src/: 项目的源代码目录,包含背景脚本、内容脚本、弹出窗口和选项页面。
  • .gitignore: Git忽略文件列表。
  • LICENSE: 项目的许可证文件。
  • README.md: 项目说明文档。
  • manifest.json: 浏览器扩展的配置文件。
  • package.json: Node.js项目的配置文件。

2. 项目的启动文件介绍

项目的启动文件主要是 manifest.json,它定义了浏览器扩展的基本信息和启动配置。以下是 manifest.json 的主要内容:

{
  "manifest_version": 2,
  "name": "Terms of Service; Didn't Read",
  "version": "1.0",
  "description": "I have read and agree to the Terms is the biggest lie on the web. We aim to fix that.",
  "icons": {
    "16": "assets/icons/icon16.png",
    "48": "assets/icons/icon48.png",
    "128": "assets/icons/icon128.png"
  },
  "background": {
    "scripts": ["src/background/background.js"]
  },
  "content_scripts": [
    {
      "matches": ["<all_urls>"],
      "js": ["src/content/content.js"]
    }
  ],
  "browser_action": {
    "default_popup": "src/popup/popup.html",
    "default_icon": {
      "16": "assets/icons/icon16.png",
      "48": "assets/icons/icon48.png",
      "128": "assets/icons/icon128.png"
    }
  },
  "options_ui": {
    "page": "src/options/options.html",
    "open_in_tab": true
  },
  "permissions": [
    "activeTab",
    "storage"
  ]
}
  • manifest_version: 指定清单文件的版本。
  • name: 扩展的名称。
  • version: 扩展的版本号。
  • description: 扩展的描述。
  • icons: 扩展的图标。
  • background: 背景脚本的配置。
  • content_scripts: 内容脚本的配置。
  • browser_action: 浏览器动作的配置,包括弹出窗口。
  • options_ui: 选项页面的配置。
  • permissions: 扩展所需的权限。

3. 项目的配置文件介绍

项目的配置文件主要是 package.json,它定义了Node.js项目的依赖和脚本。以下是 package.json 的主要内容:

{
  "name": "tosdr-browser-extensions",
  "version": "1.0.0",
  "description": "Browser extensions for Terms of Service; Didn't Read",
  "main": "index.js",
  "scripts": {
    "build": "webpack",
    "watch": "webpack --watch",
    "test": "jest"
  },
  "author": "TOSDR",
  "license": "AGPL-3.0",
  "dependencies": {
    "react": "^17.0.2",
    "react-dom": "^17.0.2"
  },
  "devDependencies": {
    "@babel/core": "^7.14.6",
    "babel-loader": "^8.2.2",
    "webpack": "^5.

browser-extensionsBrowser extensions for Terms of Service; Didn't Read. “I have read and agree to the Terms” is the biggest lie on the web. We aim to fix that. Get informed instantly about websites' terms & privacy policies, with ratings and summaries from the www.tosdr.org initiative. 项目地址:https://gitcode.com/gh_mirrors/br/browser-extensions

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

解杏茜

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值