Skip to content

Commit fa33c24

Browse files
committed
不同浏览器 manifest 版本适配
1 parent c757e5c commit fa33c24

File tree

3 files changed

+63
-3
lines changed

3 files changed

+63
-3
lines changed

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
11
<p align="center"><img width="100" alt="CUC Tronclass Courseware Downloader" src="img/tronclass-dl.jpg"></p>
22
<p align="center">CUC 畅课(TronClass) <strong>课件下载</strong> 浏览器插件</p>
33

4-
<h2 align="center">TronCUClass</h2>
4+
<p align="center"><a rel="noreferrer noopener" href="https://chrome.google.com/webstore/detail/troncuclass/oekepilgaknaenpkamkpiigfndkjlmil"><img alt="Chrome Web Store" src="https://img.shields.io/badge/Chrome-141e24.svg?&style=for-the-badge&logo=google-chrome&logoColor=white&color=04acbd"></a> <a rel="noreferrer noopener" href="https://addons.mozilla.org/zh-CN/firefox/addon/troncuclass/"><img alt="Firefox Add-ons" src="https://img.shields.io/badge/Firefox-141e24.svg?&style=for-the-badge&logo=firefox-browser&logoColor=white&color=04acbd"></a>
5+
6+
<h2 align="center">TronCUClass</h2>
7+
8+
<p align="center">TronCUClass 支持 <strong>CUC</strong> 畅课平台上任意格式的课件下载。成功开始下载的非视频类课件,其对应在畅课平台上的进度将自动标记为已完成。</p>
9+
10+
## Dev
11+
12+
- 开发环境初始化
13+
14+
```bash
15+
git clone https://github.com/YanhuiJessica/TronCUClass.git
16+
cd TronCUClass/
17+
npm install
18+
```
19+
20+
- 根据当前使用浏览器的不同,将 `public` 目录下的 `manifest.json.chrome``manifest.json.firefox` 的文件名修改为 `manifest.json`
21+
- 在项目根目录执行:`npm run build`

public/manifest.json.chrome

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
3+
"manifest_version": 3,
4+
"name": "TronCUClass",
5+
"version": "1.0.0",
6+
7+
"description": "CUC 畅课课件下载(支持所有格式) Download coursewares for CUC Tronclass (all types available)",
8+
"homepage_url": "https://github.com/YanhuiJessica/TronCUClass",
9+
10+
"icons": {
11+
"32": "icons/tronclass-dl-32.png",
12+
"48": "icons/tronclass-dl-48.png"
13+
},
14+
15+
"permissions": [
16+
"activeTab", "downloads"
17+
],
18+
"host_permissions": [
19+
"*://courses.cuc.edu.cn/*",
20+
"*://maxcdn.bootstrapcdn.com/*"
21+
],
22+
23+
"action": {
24+
"default_icon": {
25+
"32": "icons/tronclass-dl-32.png",
26+
"48": "icons/tronclass-dl-48.png"
27+
},
28+
"default_title": "TronCUClass",
29+
"default_popup": "index.html"
30+
},
31+
32+
"content_scripts": [
33+
{
34+
"matches": ["*://courses.cuc.edu.cn/course/*"],
35+
"js": ["js/content.js"]
36+
}
37+
],
38+
39+
"background": {
40+
"service_worker": "js/background.js"
41+
}
42+
}
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
"manifest_version": 2,
44
"name": "TronCUClass",
5-
"version": "0.3.0",
5+
"version": "1.0.0",
66

77
"description": "CUC 畅课课件下载(支持所有格式) Download coursewares for CUC Tronclass (all types available)",
88
"homepage_url": "https://github.com/YanhuiJessica/TronCUClass",
@@ -14,7 +14,8 @@
1414

1515
"permissions": [
1616
"activeTab", "downloads",
17-
"*://courses.cuc.edu.cn/*"
17+
"*://courses.cuc.edu.cn/*",
18+
"*://maxcdn.bootstrapcdn.com/*"
1819
],
1920

2021
"browser_action": {

0 commit comments

Comments
 (0)