Microsoft-Reward-Chrome-Ext 项目教程

Microsoft-Reward-Chrome-Ext 项目教程

Microsoft-Reward-Chrome-ExtA Chrome extension for Microsoft Rewards search, for accounts with two-factor authentication.项目地址:https://gitcode.com/gh_mirrors/mi/Microsoft-Reward-Chrome-Ext

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

Microsoft-Reward-Chrome-Ext/
├── src/
│   ├── background.js
│   ├── content.js
│   ├── options.html
│   ├── options.js
│   ├── popup.html
│   ├── popup.js
│   ├── styles.css
│   └── manifest.json
├── .gitignore
├── LICENSE
├── README.md
├── package.json
└── useragents.json
  • src/: 包含项目的所有源代码文件。
    • background.js: 后台脚本,处理扩展的主要逻辑。
    • content.js: 内容脚本,与网页内容交互。
    • options.html: 选项页面,用户可以配置扩展的设置。
    • options.js: 选项页面的脚本。
    • popup.html: 弹出窗口的HTML文件。
    • popup.js: 弹出窗口的脚本。
    • styles.css: 样式文件,定义扩展的外观。
    • manifest.json: 清单文件,定义扩展的元数据和配置。
  • .gitignore: Git忽略文件,指定不需要版本控制的文件和目录。
  • LICENSE: 许可证文件,说明项目的许可协议。
  • README.md: 项目说明文档。
  • package.json: Node.js项目配置文件,包含依赖和脚本。
  • useragents.json: 用户代理字符串配置文件。

2. 项目的启动文件介绍

项目的启动文件是 src/manifest.json,这是一个Chrome扩展的清单文件,它定义了扩展的元数据和配置。以下是该文件的主要内容:

{
  "manifest_version": 2,
  "name": "Microsoft Rewards Bot",
  "version": "1.0",
  "description": "A Chrome extension for Microsoft Rewards which automatically clears PC, mobile, and Edge search quests.",
  "permissions": [
    "activeTab",
    "storage",
    "tabs",
    "https://www.bing.com/*"
  ],
  "background": {
    "scripts": ["background.js"],
    "persistent": false
  },
  "browser_action": {
    "default_popup": "popup.html",
    "default_icon": {
      "16": "images/icon16.png",
      "48": "images/icon48.png",
      "128": "images/icon128.png"
    }
  },
  "options_ui": {
    "page": "options.html",
    "open_in_tab": true
  },
  "content_scripts": [
    {
      "matches": ["https://www.bing.com/*"],
      "js": ["content.js"]
    }
  ]
}
  • manifest_version: 指定清单文件的版本,当前为2。
  • name: 扩展的名称。
  • version: 扩展的版本号。
  • description: 扩展的描述。
  • permissions: 扩展所需的权限。
  • background: 后台脚本配置。
  • browser_action: 浏览器动作配置,定义弹出窗口和图标。
  • options_ui: 选项页面的配置。
  • content_scripts: 内容脚本的配置。

3. 项目的配置文件介绍

项目的配置文件主要是 src/manifest.jsonuseragents.json

src/manifest.json

如上所述,manifest.json 是Chrome扩展的清单文件,定义了扩展的元数据和配置。

useragents.json

useragents.json 文件包含用户代理字符串的配置,用于模拟不同的设备和浏览器。以下是该文件的示例内容:

{
  "pc": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
  "mobile": "Mozilla/5.0 (Linux; Android 10; SM-G973U) Apple

Microsoft-Reward-Chrome-ExtA Chrome extension for Microsoft Rewards search, for accounts with two-factor authentication.项目地址:https://gitcode.com/gh_mirrors/mi/Microsoft-Reward-Chrome-Ext

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

龙琴允

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

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

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

打赏作者

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

抵扣说明:

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

余额充值