forked from justjavac/ReplaceGoogleCDN
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
新增 扩展程序选项雏形、格式化代码、新增高阶定制玩法辅助工具、新增自动化测试脚本 (justjavac#100)
* 重新启用对firefox 的支持和衍生新仓库 * 新增 高阶定制玩法 辅助工具 新增 扩展程序选项 使用 prettier 格式化代码 * change options_ui * test update-auth.sh * save update-domain.sh changed * save change * fix error * fix error * add public static library * fix error * 修改打包程序,打包时去除无用文件 * fix test/READM.md test * change v2 version * change auto deploy.yaml setup * change release-archive.sh * 扩展选项:添加规则功能暂时屏蔽
- Loading branch information
1 parent
bf8e2e8
commit d384a81
Showing
51 changed files
with
1,746 additions
and
599 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,78 @@ | ||
# CHANGELOG | ||
|
||
## [测试用例](/extension/test/README.md) | ||
## [一个完整的 测试环境例子 ](https://github.com/jingjingxyk/extension-v3-test) | ||
|
||
## [一个完整的 测试环境例子 可用于查看优秀的源码 ](https://github.com/jingjingxyk/extension-v3-test) | ||
|
||
## CHANGELOG for 0.10.7 [2022-07-31 12:43:40 +0800] | ||
|
||
> 1. 新增 `developers.google.com` - 替换为 `developers.google.cn` | ||
> 2. 整理规则,合并规则文件,并且重命名名称 | ||
> 3. 新增 高阶定制玩法 辅助工具 | ||
> 4. 新增 扩展程序选项 WebUI 可视化自定义规则雏形 | ||
> 5. 使用 prettier 格式化代码 | ||
> 6. 添加自动化测试脚本 | ||
## CHANGELOG for 0.10.6 | ||
> 1. 重新启用对firefox 的支持, 启用的扩展位于 `extension-v2` 目录 | ||
> 2. 移除目录 `extension/test/extension-v3-test` | ||
> 3. 移除的目录衍生新仓库 [extension-v3-test](https://github.com/jingjingxyk/extension-v3-test) | ||
|
||
> 1. 重新启用对 firefox 的支持, 启用的扩展位于 `extension-v2` 目录 | ||
> 2. 移除目录 `extension/test/extension-v3-test` | ||
> 3. 衍生新仓库 [extension-v3-test](https://github.com/jingjingxyk/extension-v3-test) | ||
## CHANGELOG for 0.10.5 | ||
>1. 新增 `cdn.jsdelivr.net` - 替换为 `fastly.jsdelivr.net` | ||
>2. 新增 `cdnjs.cloudflare.com` - 替换为 `cdnjs.loli.net` 默认未启用 | ||
>3. 新增 公共 CDN 静态资源库 极客族公共加速服务 `https://cdn.geekzu.org/cached.html` | ||
>4. 新增 公共 CDN 静态资源库 七牛静态库 `http://staticfile.org/` | ||
>5. 新增 通过国内镜像 克隆本项目源代码 | ||
|
||
> 1. 新增 `cdn.jsdelivr.net` - 替换为 `fastly.jsdelivr.net` | ||
> 2. 新增 `cdnjs.cloudflare.com` - 替换为 `cdnjs.loli.net` 默认未启用 | ||
> 3. 新增 公共 CDN 静态资源库 极客族公共加速服务 `https://cdn.geekzu.org/cached.html` | ||
> 4. 新增 公共 CDN 静态资源库 七牛静态库 `http://staticfile.org/` | ||
> 5. 新增 通过国内镜像 克隆本项目源代码 | ||
## CHANGELOG for 0.10.4 | ||
|
||
### 变更 | ||
>1. 修复 `www.google.com/recaptcha/` 无法显示问题; 通过新增 `extension/rules/rules_redirect_1_extra.json`实现 | ||
>2. test 环境 修改: `extension/test/extension-v3-test/README.md` 描述 | ||
>3. 格式化文件: `extension/rules/rules_redirect_1.json` | ||
>4. 修复 `https://pub.dev/` 无法地址重定向;通过移除`pub.dev`的响应头`content-security-policy`实现 | ||
>5. test 用例 新增 `extension/test/README.md` 测试用例记录 | ||
|
||
> 1. 修复 `www.google.com/recaptcha/` 无法显示问题; 通过新增 `extension/rules/rules_redirect_1_extra.json`实现 | ||
> 2. test 环境 修改: `extension/test/extension-v3-test/README.md` 描述 | ||
> 3. 格式化文件: `extension/rules/rules_redirect_1.json` | ||
> 4. 修复 `https://pub.dev/` 无法地址重定向;通过移除`pub.dev`的响应头`content-security-policy`实现 | ||
> 5. test 用例 新增 `extension/test/README.md` 测试用例记录 | ||
## CHANGELOG for 0.10.3 | ||
|
||
### 变更 | ||
>1. 新增 公共 CDN 静态资源库 中科大 `rules/README.md` | ||
>2. 修改屏蔽 `content-security-policy`功能,新增4个屏蔽选项 ` ["cross-origin-embedder-policy", "cross-origin-opener-policy", "cross-origin-opener-policy-report-only","cross-origin-embedder-policy-report-only"]` | ||
>3. 新增 移除`CSP`的请求地址 `githubusercontent.com` | ||
>4. 新增 `cdnjs.cloudflare.com` 替换规则 `rules-cdnjs-cloudflare-com-redirect.json`,默认未启用 | ||
>5. test 环境 修改功能: github.com 地址替换后 PAJX 报错, 添加解决方案 `extension/test/extension-v3-test/js/content-scripts/github.js` | ||
>6. test 环境 新增功能: 自定义规则第一版雏形 `extension/test/extension-v3-test/index.html` | ||
|
||
> 1. 新增 公共 CDN 静态资源库 中科大 `rules/README.md` | ||
> 2. 修改屏蔽 `content-security-policy`功能,新增 4 个屏蔽选项 ` ["cross-origin-embedder-policy", "cross-origin-opener-policy", "cross-origin-opener-policy-report-only","cross-origin-embedder-policy-report-only"]` | ||
> 3. 新增 移除`CSP`的请求地址 `githubusercontent.com` | ||
> 4. 新增 `cdnjs.cloudflare.com` 替换规则 `rules-cdnjs-cloudflare-com-redirect.json`,默认未启用 | ||
> 5. test 环境 修改功能: github.com 地址替换后 PAJX 报错, 添加解决方案 `extension/test/extension-v3-test/js/content-scripts/github.js` | ||
> 6. test 环境 新增功能: 自定义规则第一版雏形 `extension/test/extension-v3-test/index.html` | ||
## CHANGELOG for 0.10.2 | ||
|
||
## CHANGELOG for 0.10.2 | ||
### 变更 | ||
>1. test 环境 新增功能: service-worker `sw.js` 小工具,解决因域名地址替换导致出现的问题;比如 github PJAX 错误 | ||
>2. test 环境 新增功能: service-worker `sw.js` 小工具中 `extension/test/extension-v3-test/js/tools/self-define-browser-editor.js` 浏览器当作记事本使用 | ||
>3. test 环境 新增功能: service-worker `sw.js` 小工具中 `extension/test/extension-v3-test/js/tools/myscript-tools.js` 开启"上帝"模式,可编辑网页 | ||
>4. test 环境 新增功能: service-worker `sw.js` 小工具中 `extension/test/extension-v3-test/js/tools/myscript-tools.js` 查看网页引入的所有域名 | ||
>5. 新增 `code.query.com` jquery 地址替换 | ||
>6. 解决 0.10.1 版本中 `第9 , 10条不能共用问题` | ||
>7. 删除 0.10.1 版本中 高级玩法 `excludedInitiatorDomains`错误配置 位于 `rules/rules_advance_redirect_2.json : "excludedInitiatorDomains":[] ` | ||
>8. maxcdn.bootstrapcdn.com 替换为 lib.baomitu.com | ||
|
||
> 1. test 环境 新增功能: service-worker `sw.js` 小工具,解决因域名地址替换导致出现的问题;比如 github PJAX 错误 | ||
> 2. test 环境 新增功能: service-worker `sw.js` 小工具中 `extension/test/extension-v3-test/js/tools/self-define-browser-editor.js` 浏览器当作记事本使用 | ||
> 3. test 环境 新增功能: service-worker `sw.js` 小工具中 `extension/test/extension-v3-test/js/tools/myscript-tools.js` 开启"上帝"模式,可编辑网页 | ||
> 4. test 环境 新增功能: service-worker `sw.js` 小工具中 `extension/test/extension-v3-test/js/tools/myscript-tools.js` 查看网页引入的所有域名 | ||
> 5. 新增 `code.query.com` jquery 地址替换 | ||
> 6. 解决 0.10.1 版本中 `第9 , 10条不能共用问题` | ||
> 7. 删除 0.10.1 版本中 高级玩法 `excludedInitiatorDomains`错误配置 位于 `rules/rules_advance_redirect_2.json : "excludedInitiatorDomains":[] ` | ||
> 8. maxcdn.bootstrapcdn.com 替换为 lib.baomitu.com | ||
## CHANGELOG for 0.10.1 新增适配 chromium manifest v3 版本 | ||
|
||
## CHANGELOG for 0.10.1 新增适配 chromium manifest v3版本 | ||
### 变更 | ||
|
||
>1. `manifest.json -> manifest-v2.json` (已复制保存) | ||
>2. `background.js` 不再使用了 | ||
>3. `manifest.json: manifest_version -> 3` | ||
>4. 新增 `chromium manifest v3 declarativeNetRequest rules ` | ||
>5. 新增 `v3 redirect url rule (rules/rules_redirect_1.json)` | ||
>6. 新增 `v3 remove response header rule` 可以移除CSP选项 ` (rules/rules_remove_header_1.json)` | ||
>7. 新增 `v3 append request header rule` 可向请求头添加内容 `(rules/rules_append_header_1.json)` | ||
>8. 新增 `v3 block request header rule` 锁请求 `(rules/rules_block_1.json)` | ||
>9. 新增 v3 固定替换地址 rule `(rules/rules_advance_redirect_1.json)` | ||
>10. 新增 v3 动态替换地址 rule ` (rules/rules_advance_redirect_2.json)` | ||
>11. 上述第9-10条不能同时使用,会产生冲突 | ||
> 1. `manifest.json -> manifest-v2.json` (已复制保存) | ||
> 2. `background.js` 不再使用了 | ||
> 3. `manifest.json: manifest_version -> 3` | ||
> 4. 新增 `chromium manifest v3 declarativeNetRequest rules ` | ||
> 5. 新增 `v3 redirect url rule (rules/rules_redirect_1.json)` | ||
> 6. 新增 `v3 remove response header rule` 可以移除 CSP 选项 ` (rules/rules_remove_header_1.json)` | ||
> 7. 新增 `v3 append request header rule` 可向请求头添加内容 `(rules/rules_append_header_1.json)` | ||
> 8. 新增 `v3 block request header rule` 锁请求 `(rules/rules_block_1.json)` | ||
> 9. 新增 v3 固定替换地址 rule `(rules/rules_advance_redirect_1.json)` | ||
> 10. 新增 v3 动态替换地址 rule ` (rules/rules_advance_redirect_2.json)` | ||
> 11. 上述第 9-10 条不能同时使用,会产生冲突 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# 启用同时支持 chromium 和 firefox | ||
# 启用同时支持 chromium 和 firefox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
chrome.runtime.onInstalled.addListener((details) => { | ||
|
||
}); | ||
chrome.runtime.onInstalled.addListener((details) => {}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,52 @@ | ||
{ | ||
"name": "Replace Google CDN", | ||
"version": "0.10.5", | ||
"manifest_version": 3, | ||
"icons": { | ||
"128": "icons/128.png" | ||
}, | ||
"description": "将 Google CDN 替换为国内镜像", | ||
"background": { | ||
"service_worker": "js/background.js", | ||
"type": "module" | ||
}, | ||
"permissions": [ | ||
"declarativeNetRequest", | ||
"declarativeNetRequestWithHostAccess", | ||
"declarativeNetRequestFeedback" | ||
], | ||
"host_permissions": [ | ||
"<all_urls>" | ||
], | ||
"declarative_net_request" : { | ||
"rule_resources" : [ | ||
{ | ||
"id": "ruleset_redirect_1", | ||
"enabled": true, | ||
"path": "rules/rules_redirect_1.json" | ||
}, | ||
{ | ||
"id": "ruleset_redirect_1_extra", | ||
"enabled": true, | ||
"path": "rules/rules_redirect_1_extra.json" | ||
}, | ||
{ | ||
"id": "ruleset_jquery_redirect_1", | ||
"enabled": true, | ||
"path": "rules/rules-code-jquery-redirect.json" | ||
}, | ||
{ | ||
"id": "ruleset_remove_header_1", | ||
"enabled": true, | ||
"path": "rules/rules_remove_header_1.json" | ||
}, | ||
{ | ||
"id": "ruleset_domain_replace_1", | ||
"enabled": false, | ||
"path": "rules/rules-domain-replace.json" | ||
}, | ||
{ | ||
"id": "ruleset_cdn-jsdelivr-net_replace", | ||
"enabled": true, | ||
"path": "rules/rules-cdn-jsdelivr-net-redirect.json" | ||
} | ||
] | ||
}, | ||
"author": "https://github.com/justjavac", | ||
"homepage_url": "https://github.com/justjavac/ReplaceGoogleCDN" | ||
} | ||
{ | ||
"name": "Replace Google CDN", | ||
"version": "0.10.7", | ||
"manifest_version": 3, | ||
"icons": { | ||
"128": "icons/128.png" | ||
}, | ||
"description": "将 Google CDN 替换为国内镜像", | ||
"background": { | ||
"service_worker": "js/background.js", | ||
"type": "module" | ||
}, | ||
"permissions": [ | ||
"declarativeNetRequest", | ||
"declarativeNetRequestWithHostAccess", | ||
"declarativeNetRequestFeedback" | ||
], | ||
"host_permissions": ["<all_urls>"], | ||
"declarative_net_request": { | ||
"rule_resources": [ | ||
{ | ||
"id": "ruleset_redirect_main", | ||
"enabled": true, | ||
"path": "rules/rules_redirect_main.json" | ||
}, | ||
{ | ||
"id": "ruleset_redirect_main_extra", | ||
"enabled": true, | ||
"path": "rules/rules_redirect_main_extra.json" | ||
}, | ||
{ | ||
"id": "ruleset_remove_content_security_policy_header", | ||
"enabled": true, | ||
"path": "rules/rules_remove_content_security_policy_header.json" | ||
}, | ||
{ | ||
"id": "ruleset_domain_replace", | ||
"enabled": false, | ||
"path": "rules/rules_domain_replace.json" | ||
} | ||
] | ||
}, | ||
"content_security_policy": { | ||
"extension_pages": "default-src 'self';script-src 'self' 'wasm-unsafe-eval' ;object-src 'self'; style-src 'self' 'unsafe-inline';" | ||
}, | ||
"options_ui": { | ||
"page": "options_ui/index.html", | ||
"open_in_tab": true | ||
}, | ||
"author": "https://github.com/justjavac", | ||
"homepage_url": "https://github.com/justjavac/ReplaceGoogleCDN" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
body { | ||
background-color: #f8f8f8; | ||
} | ||
|
||
input { | ||
min-width: 400px; | ||
} | ||
li { | ||
font-size: 16px; | ||
} | ||
|
||
textarea { | ||
min-width: 200px; | ||
min-height: 200px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Title</title> | ||
<link href="/options_ui/css/app.css" type="text/css" rel="stylesheet" /> | ||
</head> | ||
<body> | ||
<h1>扩展选项</h1> | ||
|
||
<h2>添加自定义规则</h2> | ||
<div class="wrap"> | ||
<div class="container"> | ||
<div class="old-rule-list"></div> | ||
<section class="box"> | ||
<!-- | ||
<input | ||
name="rule" | ||
type="text" | ||
placeholder="添加规则功能未完善(不可用),希望有同志可以完善以下" | ||
/> | ||
--> | ||
<button type="submit">提交规则</button> | ||
</section> | ||
</div> | ||
</div> | ||
<h2>已启用的规则列表:</h2> | ||
<ul class="rule_set_list"> | ||
<li></li> | ||
</ul> | ||
<h2>规则详情:</h2> | ||
<div> | ||
<textarea cols="200" rows="40" id="rule-content-container"></textarea> | ||
</div> | ||
<script src="/options_ui/js/app.js"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.