diff --git a/CHANGELOG-v2-x.x.x.md b/CHANGELOG-v2-x.x.x.md index eef28e50..cf63e15a 100644 --- a/CHANGELOG-v2-x.x.x.md +++ b/CHANGELOG-v2-x.x.x.md @@ -1,17 +1,17 @@ -# CHANGELOG for v2 +# v2 -## CHANGELOG for v2 0.10.17 [2023-12-05 00:49:00 +0800] +## v2 0.10.17 [2023-12-05 00:49:00 +0800] -> 1. 格式化代码 +1. 格式化代码 -## CHANGELOG for v2 0.10.16 [2023-02-09 13:01:00 +0800] +## v2 0.10.16 [2023-02-09 13:01:00 +0800] -> 1. v2 版本 修改 高级用法分离出去,精简默认代码 -> 1. v2 版本 升级 到 0.10.16 +1. v2 版本 修改 高级用法分离出去,精简默认代码 +2. v2 版本 升级 到 0.10.16 -## CHANGELOG for v2 0.10.15 [2023-02-06 23:49:00 +0800] +## v2 0.10.15 [2023-02-06 23:49:00 +0800] -> 1. v2 版本 修改 `fonts.gstatic.com` 和 `fonts.gstatic.com` 重定向地址 -> 1. v2 版本 新增 `developer.android.com` 地址重定向 -> 1. v2 版本 新增 `source.android.com` 地址重定向 -> 1. v2 版本 升级 到 0.10.15 +1. v2 版本 修改 `fonts.gstatic.com` 和 `fonts.gstatic.com` 重定向地址 +2. v2 版本 新增 `developer.android.com` 地址重定向 +3. v2 版本 新增 `source.android.com` 地址重定向 +4. v2 版本 升级 到 0.10.15 diff --git a/CHANGELOG-v3-x.x.x.md b/CHANGELOG-v3-x.x.x.md index 2fddbf3b..78df8847 100644 --- a/CHANGELOG-v3-x.x.x.md +++ b/CHANGELOG-v3-x.x.x.md @@ -1,229 +1,261 @@ -# CHANGELOG for v3 +# v3 -## CHANGELOG for v3 0.11.0 [2023-12-06 21:01:00 +0800] +## v3 0.11.0 [2024-07-17 14:49:00 +0800] -> 1. 新增: 新增备份自定义规则功能 -> 1. 变更: 移除备份所有动态规则功能 +1. 移除无效、不可用的候选项地址 [不可用的 资源库 详情](public-cdn.md) +2. 更新 README.md -## CHANGELOG for v3 0.10.32 [2023-12-05 15:01:00 +0800] +## v3 0.11.0 [2023-12-06 21:01:00 +0800] -> 1. 新增: 创建 文档目录 `docs` -> 1. 变更: 将辅助工具迁移到扩展目录外 -> 1. 变更: 将高级功能脚本、规则移动到 `experimental-features` 目录 , 部分实验脚本迁移到 [extension-v3-test](https://github.com/jingjingxyk/extension-v3-test.git) 仓库 +1. 新增: 新增备份自定义规则功能 +2. 变更: 移除备份所有动态规则功能 -## CHANGELOG for v3 0.10.31 [2023-12-02 22:01:00 +0800] +## v3 0.10.32 [2023-12-05 15:01:00 +0800] -> 1. 新增: 对 firefox 提供基础版功能,暂不提供高级功能。详情: [NDR 正则表达式 未定版 ](https://github.com/w3c/webextensions/issues/344) -> 1. 变更: 精简打包命令 -> 1. 变更: 使用 prettier 格式化代码 -> 1. 新增: github action workflows 实现命令行下载浏览器 并加载扩展,运行无界面加载扩展 (非headless 模式) +1. 新增: 创建 文档目录 `docs` +2. 变更: 将辅助工具迁移到扩展目录外 +3. 变更: 将高级功能脚本、规则移动到 `experimental-features` 目录 , -## CHANGELOG for v3 0.10.30 [2023-09-02 11:01:00 +0800] + 部分实验脚本迁移到 [extension-v3-test](https://github.com/jingjingxyk/extension-v3-test.git) 仓库 -> 1. 新增: URL 匹配规则添加 `scheme` 匹配,收缩匹配范围 -> 1. 新增: 默认规则实现兼容 firefox -> 1. 新增: 准备发布 v3 1.0.0 版本 -> 1. 变更: 修改规则`developer.android.com`,`developers.google.com`,`source.android.com`,`developers.google.com`,`source.android.com` 默认不启用 -> 1. 变更: 准备归档不属于扩展的目录和文件(进行中) -> 1. 变更: 移除 2 种不支持的规则类型 `"webtransport"`,`"webbundle"` ,实现兼容 firefox -> 1. 修复: [修复匹配规则宽泛 bug](https://github.com/justjavac/ReplaceGoogleCDN/issues/182) -> 1. 变更: `imgur.com` 的候选项规则 删除无效的候选项 `search.pstatic.net` -> 1. 变更: `lh3.googleusercontent.com` 的候选项规则 删除无效的候选项 `search.pstatic.net` +## v3 0.10.31 [2023-12-02 22:01:00 +0800] -## CHANGELOG for v3 0.10.29 [2023-07-06 14:20:00 +0800] +1. 新增: 对 firefox -> 1. 升级 josdejong/svelte-jsoneditor 并确定其版本为 v0.17.8 -> 2. 支持 firefox 浏览器,firefox 版本需要 >= v113 -> 3. 添加 python 脚本 便捷修改 manifest.json 文件,打包时构建支持 firefox 版本 + 提供基础版功能,暂不提供高级功能。详情: [NDR 正则表达式 未定版 ](https://github.com/w3c/webextensions/issues/344) -## CHANGELOG for v3 0.10.28 [2023-04-12 15:38:00 +0800] +1. 变更: 精简打包命令 +1. 变更: 使用 prettier 格式化代码 +1. 新增: github action workflows 实现命令行下载浏览器 并加载扩展,运行无界面加载扩展 (非headless 模式) -> 1. 域名`lh3.googleusercontent.com` 和 `imgur.com` 添加辅助规则。 删除请求头中 `referer` 键值对 -> 1. 域名`lh3.googleusercontent.com` 和 `imgur.com` 重定向规则 资源类型,仅限图片 -> 1. 域名`fonts.googleapis.com` 和 `fonts.googleapis.com` 修改重定向规则,修改重定向到的目标地址 +## v3 0.10.30 [2023-09-02 11:01:00 +0800] -## CHANGELOG for v3 0.10.27 [2023-04-02 21:50:00 +0800] +1. 新增: URL 匹配规则添加 `scheme` 匹配,收缩匹配范围 +2. 新增: 默认规则实现兼容 firefox +3. 新增: 准备发布 v3 1.0.0 版本 +4. 变更: -> 1. v3 版本 修复 通过重新组织代码,解决删除单条规则时,重复渲染动态规则列表的 bug + 修改规则`developer.android.com`,`developers.google.com`,`source.android.com`,`developers.google.com`,`source.android.com` + 默认不启用 -## CHANGELOG for v3 0.10.26 [2023-03-31 13:27:00 +0800] +5. 变更: 准备归档不属于扩展的目录和文件(进行中) +6. 变更: 移除 2 种不支持的规则类型 `"webtransport"`,`"webbundle"` ,实现兼容 firefox +7. 修复: [修复匹配规则宽泛 bug](https://github.com/justjavac/ReplaceGoogleCDN/issues/182) +8. 变更: `imgur.com` 的候选项规则 删除无效的候选项 `search.pstatic.net` +9. 变更: `lh3.googleusercontent.com` 的候选项规则 删除无效的候选项 `search.pstatic.net` -> 1. v3 版本 修复 修复打包 bug (打包补上 josdejong/svelte-jsoneditor) +## v3 0.10.29 [2023-07-06 14:20:00 +0800] -## CHANGELOG for v3 0.10.25 [2023-03-05 23:25:00 +0800] +1. 升级 josdejong/svelte-jsoneditor 并确定其版本为 v0.17.8 +2. 支持 firefox 浏览器,firefox 版本需要 >= v113 +3. 添加 python 脚本 便捷修改 manifest.json 文件,打包时构建支持 firefox 版本 -> 1. v3 版本 添加 格式化规则功能 -> 1. v3 版本 修改 规则条块颜色调整 +## v3 0.10.28 [2023-04-12 15:38:00 +0800] -## CHANGELOG for v3 0.10.24 [2023-02-19 21:25:00 +0800] +1. 域名`lh3.googleusercontent.com` 和 `imgur.com` 添加辅助规则。 删除请求头中 `referer` 键值对 +2. 域名`lh3.googleusercontent.com` 和 `imgur.com` 重定向规则 资源类型,仅限图片 +3. 域名`fonts.googleapis.com` 和 `fonts.googleapis.com` 修改重定向规则,修改重定向到的目标地址 -> 1. v3 版本 添加 默认候选规则,规则 id=9999,priority=9999(暂不启用) -> 1. v3 版本 备注信息: 规则 id=9999,用于覆盖其他地址重定向规则 -> 1. v3 版本 添加 JSON [(josdejong/svelte-jsoneditor)](https://github.com/josdejong/svelte-jsoneditor)格式化工具 +## v3 0.10.27 [2023-04-02 21:50:00 +0800] -## CHANGELOG for v3 0.10.23 [2023-02-07 11:21:00 +0800] +1. v3 版本 修复 通过重新组织代码,解决删除单条规则时,重复渲染动态规则列表的 bug -> 1. v3 版本 修改 静态规则和默认候选项规则 规则编号统一一致 -> 1. v3 版本 修改 默认启用`developer.android.com` 地址重定向 -> 1. v3 版本 修改 默认启用`source.android.com` 地址重定向 -> 1. v3 版本 升级 到 0.10.23 +## v3 0.10.26 [2023-03-31 13:27:00 +0800] -## CHANGELOG for v3 0.10.22 [2023-02-06 23:49:00 +0800] +1. v3 版本 修复 修复打包 bug (打包补上 josdejong/svelte-jsoneditor) -> 1. v3 版本 修改 扩展选项页面拆分为 2 个页面,分别是默认配置页面和高级配置页面 -> 1. v3 版本 新增 默认候选项新增域名`developer.android.com` -> 1. v3 版本 新增 默认候选项新增域名`source.android.com` -> 1. v3 版本 升级 到 0.10.22 +## v3 0.10.25 [2023-03-05 23:25:00 +0800] -## CHANGELOG for 0.10.21 [2023-02-05 13:22:30 +0800] +1. v3 版本 添加 格式化规则功能 +2. v3 版本 修改 规则条块颜色调整 -> 1. 默认候选项新增域名`developer.android.com` -> 1. 默认候选项新增域名`lh3.googleusercontent.com` -> 1. 默认候选项新增域名`cdn.sstatic.net` -> 1. 默认候选项新增域名`imgur.com` -> 1. 重定向例子 `golang.org/dl/` -> 1. 重定向例子 `commondatastorage.googleapis.com/chromium-browser-snapshots` -> 1. 规则列表区块颜色调整,用于区分不同的规则区间 +## v3 0.10.24 [2023-02-19 21:25:00 +0800] -## CHANGELOG for 0.10.20 [2023-01-30 23:12:54 +0800] +1. v3 版本 添加 默认候选规则,规则 id=9999,priority=9999(暂不启用) +2. v3 版本 备注信息: 规则 id=9999,用于覆盖其他地址重定向规则 +3. v3 版本 添加 JSON [(josdejong/svelte-jsoneditor)](https://github.com/josdejong/svelte-jsoneditor)格式化工具 -> 1. 移除无效的静态资源库 [辉哥博客&蓝易云安全](https://www.haah.net/archives/7885.html) -> 1. `fonts.googleapis.com` 重定向到 `fonts.googleapis.cn` -> 1. `fonts.gstatic.com` 重定向到 `fonts.gstatic.cn` -> 1. 新增使用扩展的修改响应头和请求头的功能解决跨域的例子 (CORS.json) -> 1. 新增解决 stackoverflow.com 网站下 cdn.sstatic.net 域下静态资源加载慢的例子 (sstatic.net-stackoverflow.com.json) -> 1. 修改演示例子里地址链接 +## v3 0.10.23 [2023-02-07 11:21:00 +0800] -## CHANGELOG for 0.10.19 [2022-12-29 12:41:02 +0800] +1. v3 版本 修改 静态规则和默认候选项规则 规则编号统一一致 +1. v3 版本 修改 默认启用`developer.android.com` 地址重定向 +1. v3 版本 修改 默认启用`source.android.com` 地址重定向 +1. v3 版本 升级 到 0.10.23 -> 1. 添加 域名重定向到扩展指定指定页面的例子 -> 1. 修改打包脚本 和 添加本地部署脚本 +## v3 0.10.22 [2023-02-06 23:49:00 +0800] -## CHANGELOG for 0.10.18 [2022-12-27 12:28:07 +0800] +1. v3 版本 修改 扩展选项页面拆分为 2 个页面,分别是默认配置页面和高级配置页面 +1. v3 版本 新增 默认候选项新增域名`developer.android.com` +1. v3 版本 新增 默认候选项新增域名`source.android.com` +1. v3 版本 升级 到 0.10.22 -> 1. 添加点击扩展图标-自动打开扩展选项页 简述 -> 1. 启用快捷打开选项页功能 -> 1. 补全默认切换选项 +## 0.10.21 [2023-02-05 13:22:30 +0800] -## CHANGELOG for 0.10.17 [2022-12-09 18:53:40 +0800] +1. 默认候选项新增域名`developer.android.com` +1. 默认候选项新增域名`lh3.googleusercontent.com` +1. 默认候选项新增域名`cdn.sstatic.net` +1. 默认候选项新增域名`imgur.com` +1. 重定向例子 `golang.org/dl/` +1. 重定向例子 `commondatastorage.googleapis.com/chromium-browser-snapshots` +1. 规则列表区块颜色调整,用于区分不同的规则区间 -> 1. 新增更新规则的功能 -> 1. v2 版本修改使用例子 +## 0.10.20 [2023-01-30 23:12:54 +0800] -## CHANGELOG for 0.10.16 [2022-11-28 19:00:00 +0800] +1. 移除无效的静态资源库 [辉哥博客&蓝易云安全](https://www.haah.net/archives/7885.html) +1. `fonts.googleapis.com` 重定向到 `fonts.googleapis.cn` +1. `fonts.gstatic.com` 重定向到 `fonts.gstatic.cn` +1. 新增使用扩展的修改响应头和请求头的功能解决跨域的例子 (CORS.json) +1. 新增解决 stackoverflow.com 网站下 cdn.sstatic.net 域下静态资源加载慢的例子 (sstatic.net-stackoverflow.com.json) +1. 修改演示例子里地址链接 -> 1. 屏蔽快捷打开选项页功能 +## 0.10.19 [2022-12-29 12:41:02 +0800] -## CHANGELOG for 0.10.15 [2022-11-21 03:53:40 +0800] +1. 添加 域名重定向到扩展指定指定页面的例子 +1. 修改打包脚本 和 添加本地部署脚本 -> 1. 为默认静态规则,准备冗余候选项 -> 1. 域名 `fonts.gstatic.com` 和 `fonts.googleapis.com` 暂时取消 地址重定向 +## 0.10.18 [2022-12-27 12:28:07 +0800] -## CHANGELOG for 0.10.14 [2022-11-19 22:17:40 +0800] +1. 添加点击扩展图标-自动打开扩展选项页 简述 +1. 启用快捷打开选项页功能 +1. 补全默认切换选项 -> 1. 新增拖拽文件上传规则 -> 1. 修改选项页 README.md -> 1. 缩小部分规则匹配场景 +## 0.10.17 [2022-12-09 18:53:40 +0800] -## CHANGELOG for 0.10.13 [2022-11-05 03:10:40 +0800] +1. 新增更新规则的功能 +1. v2 版本修改使用例子 -> 1. v2 版本扩展支持 XP 系统下 最后一个 chrome 版本 +## 0.10.16 [2022-11-28 19:00:00 +0800] -## CHANGELOG for 0.10.12 [2022-11-04 08:10:40 +0800] +1. 屏蔽快捷打开选项页功能 -> 1. v2 版本添加域名拦截功能 +## 0.10.15 [2022-11-21 03:53:40 +0800] -## CHANGELOG for 0.10.11 [2022-10-17 15:10:40 +0800] +1. 为默认静态规则,准备冗余候选项 +1. 域名 `fonts.gstatic.com` 和 `fonts.googleapis.com` 暂时取消 地址重定向 -> 1. 实现不更新扩展的前提下,同步主仓库最新版静态规则 +## 0.10.14 [2022-11-19 22:17:40 +0800] -## CHANGELOG for 0.10.10 [2022-10-16 00:25:40 +0800] +1. 新增拖拽文件上传规则 +1. 修改选项页 README.md +1. 缩小部分规则匹配场景 -> 1. 新增 `cn.gravatar.com, en.gravatar.com` 地址重定向 -> 1. `v3` 版本`manifest.json` 扩展选项页内容安全策略添加请求的地址 -> 1. `v2` 版本补上 `code.jquery.com/jquery-` 替换 -> 1. 新增下载扩展的方式和地址 +## 0.10.13 [2022-11-05 03:10:40 +0800] -## CHANGELOG for 0.10.9 [2022-10-04 16:10:40 +0800] +1. v2 版本扩展支持 XP 系统下 最后一个 chrome 版本 -> 1. 扩展选项页功能完善-第三版 -> 1. 扩展选项页增加-演示例子 -> 1. 新增扩展选项功能截图 +## 0.10.12 [2022-11-04 08:10:40 +0800] -## CHANGELOG for 0.10.8 [2022-09-30 19:43:40 +0800] +1. v2 版本添加域名拦截功能 -> 1. 扩展选项页添加同步远端规则功能 -> 2. 扩展选项页完善自定义规则功能 +## 0.10.11 [2022-10-17 15:10:40 +0800] -## CHANGELOG for 0.10.7 [2022-07-31 12:43:40 +0800] +1. 实现不更新扩展的前提下,同步主仓库最新版静态规则 -> 1. 新增 `developers.google.com` - 替换为 `developers.google.cn` -> 2. 整理规则,合并规则文件,并且重命名名称 -> 3. 新增 高阶定制玩法 辅助工具 -> 4. 新增 扩展程序选项 WebUI 可视化自定义规则雏形 -> 5. 使用 prettier 格式化代码 -> 6. 添加自动化测试脚本 +## 0.10.10 [2022-10-16 00:25:40 +0800] -## CHANGELOG for 0.10.6 +1. 新增 `cn.gravatar.com, en.gravatar.com` 地址重定向 +1. `v3` 版本`manifest.json` 扩展选项页内容安全策略添加请求的地址 +1. `v2` 版本补上 `code.jquery.com/jquery-` 替换 +1. 新增下载扩展的方式和地址 -> 1. 重新启用对 firefox 的支持, 启用的扩展位于 `extension-v2` 目录 -> 2. 移除目录 `extension/test/extension-v3-test` -> 3. 衍生新仓库 [extension-v3-test](https://github.com/jingjingxyk/extension-v3-test) +## 0.10.9 [2022-10-04 16:10:40 +0800] -## CHANGELOG for 0.10.5 +1. 扩展选项页功能完善-第三版 +1. 扩展选项页增加-演示例子 +1. 新增扩展选项功能截图 -> 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. 新增 通过国内镜像 克隆本项目源代码 +## 0.10.8 [2022-09-30 19:43:40 +0800] -## CHANGELOG for 0.10.4 +1. 扩展选项页添加同步远端规则功能 +2. 扩展选项页完善自定义规则功能 + +## 0.10.7 [2022-07-31 12:43:40 +0800] + +1. 新增 `developers.google.com` - 替换为 `developers.google.cn` +2. 整理规则,合并规则文件,并且重命名名称 +3. 新增 高阶定制玩法 辅助工具 +4. 新增 扩展程序选项 WebUI 可视化自定义规则雏形 +5. 使用 prettier 格式化代码 +6. 添加自动化测试脚本 + +## 0.10.6 + +1. 重新启用对 firefox 的支持, 启用的扩展位于 `extension-v2` 目录 +2. 移除目录 `extension/test/extension-v3-test` +3. 衍生新仓库 [extension-v3-test](https://github.com/jingjingxyk/extension-v3-test) + +## 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. 新增 通过国内镜像 克隆本项目源代码 + +## 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 +## 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` -## CHANGELOG for 0.10.2 +6. test 环境 新增功能: 自定义规则第一版雏形 `extension/test/extension-v3-test/index.html` + +## 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 版本 +## 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 条不能同时使用,会产生冲突 diff --git a/README.md b/README.md index 9480a741..d6f0a489 100644 --- a/README.md +++ b/README.md @@ -23,26 +23,28 @@ > - [浏览器 V2 API](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest), > - [浏览器 V3 API](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/declarativeNetRequest) > -> 默认未启用的规则, 如需启用请到扩展选项页自行打开 +> 默认未启用的规则, (双击扩展图标,进入扩展选项页面,可调整替换地址) 此插件/扩展可以将以下的 CDN 资源替换为国内的: -1. `ajax.googleapis.com` - 前端公共库,替换为 `ajax.loli.net` -1. `fonts.googleapis.com` - 免费字体库,替换为 `fonts.googleapis.cn` -1. `themes.googleusercontent.com` - fonts 有时会使用到这个里面的资源,替换为`themes.loli.net` -1. `fonts.gstatic.com` - 免费字体库,替换为 `fonts.gstatic.cn` -1. `www.google.com/recaptcha` - Google 图像验证库,替换为`www.recaptcha.net/recaptcha` -1. `secure.gravatar.com` - gravatar 头像,替换为 `gravatar.loli.net` -1. `maxcdn.bootstrapcdn.com/bootstrap` - bootstrap 框架使用的 CDN,替换为`lib.baomitu.com/twitter-bootstrap/` -1. `code.jquery.com/jquery-(version)(suffix)` - jquery 框架使用的 CDN,替换为`https://fastly.jsdelivr.net/npm/jquery@$verson/dist/jquery$suffix` -1. `cdnjs.cloudflare.com` - 替换为 `cdnjs.loli.net` 默认未启用, 如需启用请到扩展选项页自行打开 -1. `cdn.jsdelivr.net` - 替换为 `fastly.jsdelivr.net` -1. `developers.google.com` - 替换为 `developers.google.cn` 默认未启用, 如需启用请到扩展选项页自行打开 -1. `developer.android.com` - 替换为 `developer.android.google.cn` 默认未启用, 如需启用请到扩展选项页自行打开 -1. `source.android.com` - 替换为 `source.android.google.cn` 默认未启用, 如需启用请到扩展选项页自行打开 -1. `www.gstatic.com` - 替换为 `www.gstatic.cn` 默认未启用, 如需启用请到扩展选项页自行打开 -1. `lh3.googleusercontent.com` 默认未启用, 如需启用请到扩展选项页自行打开 -1. `cdn.sstatic.net`- 替换为 `sstatic.net` 默认未启用,如需启用请到扩展选项页自行打开 +| 序号 | 原地址 | 替换后的地址 | 是否启用 | 简述 | +|----|--------------------------------------------|---------------------------------------------------------------------|------|---------------------| +| 1 | `ajax.googleapis.com` | `ajax.loli.net` | ✅ | 前端公共库 | +| 2 | `fonts.googleapis.com` | `fonts.googleapis.cn` | ✅ | 免费字体库 | +| 3 | `themes.googleusercontent.com` | `themes.loli.net` | ✅ | fonts 资源引用 | +| 4 | `fonts.gstatic.com` | `fonts.googleapis.cn` | ✅ | 免费字体库 | +| 5 | `www.google.com/recaptcha` | `www.recaptcha.net/recaptcha` | ✅ | Google 图像验证库 | +| 6 | `secure.gravatar.com` | `gravatar.loli.net` | ✅ | gravatar 头像 | +| 7 | `maxcdn.bootstrapcdn.com/bootstrap` | `lib.baomitu.com/twitter-bootstrap/` | ✅ | bootstrap 框架使用的 CDN | +| 8 | `code.jquery.com/jquery-(version)(suffix)` | `https://fastly.jsdelivr.net/npm/jquery@$verson/dist/jquery$suffix` | ✅ | jquery 框架使用的 CDN | +| 9 | `cdnjs.cloudflare.com` | `cdnjs.loli.net` | - | - | +| 10 | `cdn.jsdelivr.net` | `fastly.jsdelivr.net` | - | - | +| 11 | `developers.google.com` | `developers.google.cn` | - | - | +| 12 | `developer.android.com` | `developer.android.google.cn` | - | - | +| 13 | `source.android.com` | `source.android.google.cn` | - | - | +| 14 | `www.gstatic.com` | `www.gstatic.cn` | - | - | +| 15 | `lh3.googleusercontent.com` | `source.android.google.cn` | - | - | +| 16 | `cdn.sstatic.net` | `sstatic.net` | - | - | ## 扩展选项页使用简述 diff --git a/experimental-features/v3/rules/example/README.md b/experimental-features/v3/rules/example/README.md index 46e50d3c..e1c353e3 100644 --- a/experimental-features/v3/rules/example/README.md +++ b/experimental-features/v3/rules/example/README.md @@ -1,12 +1 @@ # 本目录下文件 规则例子 - -## 规则编写的参考文档 - -1. [图片镜像缓存服务—防盗链图片、imgur 等国内无法访问图片的解决方案](https://funletu.com/10538/.html) - -```text -# 使用 - -https://github.com/justjavac/ReplaceGoogleCDN/blob/master/experimental-features/v3/rules/example/imgur.com-stackoverflow.com.json?raw=true - -``` diff --git a/experimental-features/v3/rules/example/imgur.com-stackoverflow.com.json b/experimental-features/v3/rules/example/imgur.com-stackoverflow.com.json index 30c2dc5a..d86d5b86 100644 --- a/experimental-features/v3/rules/example/imgur.com-stackoverflow.com.json +++ b/experimental-features/v3/rules/example/imgur.com-stackoverflow.com.json @@ -92,70 +92,6 @@ "media", "websocket", - "other" - ] - } - }, - - { - "id": 4, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "regexSubstitution": "https://pic1.xuehuaimg.com/proxy/\\1" - } - }, - "condition": { - "regexFilter": "^https?://(.*?)", - "requestDomains": ["imgur.com"], - "initiatorDomains": ["stackoverflow.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - }, - - { - "id": 5, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "regexSubstitution": "https://search.pstatic.net/common?src=\\1" - } - }, - "condition": { - "regexFilter": "(.*?)", - "requestDomains": ["imgur.com"], - "initiatorDomains": ["stackoverflow.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - "other" ] } diff --git a/experimental-features/v3/rules/example/provider/no_use/public-cdn.geekzu.org.json b/experimental-features/v3/rules/example/provider/no_use/public-cdn.geekzu.org.json deleted file mode 100644 index b2499290..00000000 --- a/experimental-features/v3/rules/example/provider/no_use/public-cdn.geekzu.org.json +++ /dev/null @@ -1,163 +0,0 @@ -[ - { - "id": 1, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "regexSubstitution": "gapis.geekzu.org/ajax/ajax/libs/\\1" - } - }, - "condition": { - "regexFilter": "ajax\\.googleapis\\.com/ajax/libs/(.*?)", - "requestDomains": ["ajax.googleapis.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - }, - { - "id": 2, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { - "scheme": "https", - "host": "fonts.geekzu.org" - } - } - }, - "condition": { - "urlFilter": "fonts.googleapis.com", - "requestDomains": ["fonts.googleapis.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - }, - { - "id": 3, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "regexSubstitution": "gapis.geekzu.org/g-fonts/\\1" - } - }, - "condition": { - "regexFilter": "fonts\\.gstatic\\.com/(.*?)", - "requestDomains": ["fonts.gstatic.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - }, - { - "id": 4, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { - "scheme": "https", - "host": "sdn.geekzu.org" - } - } - }, - "condition": { - "urlFilter": "gravatar.com", - "requestDomains": [ - "secure.gravatar.com", - "www.gravatar.com", - "cn.gravatar.com", - "en.gravatar.com" - ], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - }, - { - "id": 5, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "regexSubstitution": "gapis.geekzu.org/g-themes/\\1" - } - }, - "condition": { - "regexFilter": "themes\\.googleusercontent\\.com/(.*?)", - "requestDomains": ["themes.googleusercontent.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - } -] diff --git a/experimental-features/v3/rules/example/provider/no_use/public-cdn.haah.net.json b/experimental-features/v3/rules/example/provider/no_use/public-cdn.haah.net.json deleted file mode 100644 index d345c045..00000000 --- a/experimental-features/v3/rules/example/provider/no_use/public-cdn.haah.net.json +++ /dev/null @@ -1,304 +0,0 @@ -[ - { - "id": 1, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { - "scheme": "https", - "host": "gajax.cdn.haah.net" - } - } - }, - "condition": { - "urlFilter": "ajax.googleapis.com", - "requestDomains": ["ajax.googleapis.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - }, - { - "id": 2, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { - "scheme": "https", - "host": "js.cdn.haah.net" - } - } - }, - "condition": { - "urlFilter": "cdn.jsdelivr.net", - "requestDomains": ["cdn.jsdelivr.net"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - }, - { - "id": 3, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { - "scheme": "https", - "host": "cdnjs.cdn.haah.net" - } - } - }, - "condition": { - "urlFilter": "cdnjs.cloudflare.com", - "requestDomains": ["cdnjs.cloudflare.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - }, - { - "id": 4, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { - "scheme": "https", - "host": "gfont.cdn.haah.net" - } - } - }, - "condition": { - "urlFilter": "fonts.googleapis.com", - "requestDomains": ["fonts.googleapis.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - }, - { - "id": 5, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { - "scheme": "https", - "host": "gstatic.cdn.haah.net" - } - } - }, - "condition": { - "urlFilter": "fonts.gstatic.com", - "requestDomains": ["fonts.gstatic.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - }, - { - "id": 6, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { - "scheme": "https", - "host": "gravatar.cdn.haah.net" - } - } - }, - "condition": { - "urlFilter": "gravatar.com", - "requestDomains": [ - "secure.gravatar.com", - "www.gravatar.com", - "cn.gravatar.com", - "en.gravatar.com" - ], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - }, - { - "id": 7, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { - "scheme": "https", - "host": "gtheme.cdn.haah.net" - } - } - }, - "condition": { - "urlFilter": "themes.googleusercontent.com", - "requestDomains": ["themes.googleusercontent.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - }, - { - "id": 8, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { - "scheme": "https", - "host": "wgstatic.cdn.haah.net" - } - } - }, - "condition": { - "urlFilter": "www.gstatic.com", - "requestDomains": ["www.gstatic.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - }, - { - "id": 9, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { - "scheme": "https", - "host": "gtranslate.cdn.haah.net" - } - } - }, - "condition": { - "urlFilter": "translate.googleapis.com", - "requestDomains": ["translate.googleapis.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - } -] diff --git a/experimental-features/v3/rules/example/provider/public-cdn.loli.net.json b/experimental-features/v3/rules/example/provider/public-cdn.loli.net.json deleted file mode 100644 index 610db053..00000000 --- a/experimental-features/v3/rules/example/provider/public-cdn.loli.net.json +++ /dev/null @@ -1,205 +0,0 @@ -[ - { - "id": 1, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { - "scheme": "https", - "host": "ajax.loli.net" - } - } - }, - "condition": { - "urlFilter": "ajax.googleapis.com", - "requestDomains": ["ajax.googleapis.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - }, - { - "id": 2, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { - "scheme": "https", - "host": "cdnjs.loli.net" - } - } - }, - "condition": { - "urlFilter": "cdnjs.cloudflare.com/ajax/libs", - "requestDomains": ["cdnjs.cloudflare.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - }, - { - "id": 3, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { - "scheme": "https", - "host": "fonts.loli.net" - } - } - }, - "condition": { - "urlFilter": "fonts.googleapis.com", - "requestDomains": ["fonts.googleapis.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - }, - { - "id": 4, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { - "scheme": "https", - "host": "gstatic.loli.net" - } - } - }, - "condition": { - "urlFilter": "fonts.gstatic.com", - "requestDomains": ["fonts.gstatic.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - }, - { - "id": 5, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { - "scheme": "https", - "host": "gravatar.loli.net" - } - } - }, - "condition": { - "urlFilter": "gravatar.com", - "requestDomains": [ - "secure.gravatar.com", - "www.gravatar.com", - "cn.gravatar.com", - "en.gravatar.com" - ], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - }, - { - "id": 6, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { - "scheme": "https", - "host": "themes.loli.net" - } - } - }, - "condition": { - "urlFilter": "themes.googleusercontent.com", - "requestDomains": ["themes.googleusercontent.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - } -] diff --git a/experimental-features/v3/rules/example/provider/public-cdn.sevencdn.com.json b/experimental-features/v3/rules/example/provider/public-cdn.sevencdn.com.json deleted file mode 100644 index 06d6744f..00000000 --- a/experimental-features/v3/rules/example/provider/public-cdn.sevencdn.com.json +++ /dev/null @@ -1,133 +0,0 @@ -[ - { - "id": 1, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "regexSubstitution": "use.sevencdn.com/gajax/\\1" - } - }, - "condition": { - "regexFilter": "ajax\\.googleapis\\.com/ajax/(.*?)", - "requestDomains": ["ajax.googleapis.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - }, - { - "id": 2, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { "scheme": "https", "host": "use.sevencdn.com" } - } - }, - "condition": { - "urlFilter": "cdnjs.cloudflare.com/ajax/libs", - "requestDomains": ["cdnjs.cloudflare.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - }, - { - "id": 3, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { - "scheme": "https", - "host": "use.sevencdn.com" - } - } - }, - "condition": { - "urlFilter": "fonts.googleapis.com", - "requestDomains": ["fonts.googleapis.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - }, - { - "id": 4, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { - "scheme": "https", - "host": "use.sevencdn.com" - } - } - }, - "condition": { - "urlFilter": "gravatar.com", - "requestDomains": [ - "secure.gravatar.com", - "www.gravatar.com", - "cn.gravatar.com", - "en.gravatar.com" - ], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - } -] diff --git a/experimental-features/v3/rules/example/provider/public-cdn.sourcegcdn.com.json b/experimental-features/v3/rules/example/provider/public-cdn.sourcegcdn.com.json deleted file mode 100644 index 2ff4c2e7..00000000 --- a/experimental-features/v3/rules/example/provider/public-cdn.sourcegcdn.com.json +++ /dev/null @@ -1,106 +0,0 @@ -[ - { - "id": 1, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { - "scheme": "https", - "host": "fonts.sourcegcdn.com" - } - } - }, - "condition": { - "urlFilter": "fonts.googleapis.com", - "requestDomains": ["fonts.googleapis.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - }, - { - "id": 2, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { - "scheme": "https", - "host": "avatar.sourcegcdn.com" - } - } - }, - "condition": { - "urlFilter": "gravatar.com", - "requestDomains": [ - "secure.gravatar.com", - "www.gravatar.com", - "cn.gravatar.com", - "en.gravatar.com" - ], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - }, - { - "id": 3, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { - "scheme": "https", - "host": "cdnjs.sourcegcdn.com" - } - } - }, - "condition": { - "urlFilter": "cdnjs.cloudflare.com", - "requestDomains": ["cdnjs.cloudflare.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - } -] diff --git a/experimental-features/v3/rules/example/provider/public-cdn.ustclug.org.json b/experimental-features/v3/rules/example/provider/public-cdn.ustclug.org.json deleted file mode 100644 index f3e15bac..00000000 --- a/experimental-features/v3/rules/example/provider/public-cdn.ustclug.org.json +++ /dev/null @@ -1,68 +0,0 @@ -[ - { - "id": 1, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { - "scheme": "https", - "host": "ajax.proxy.ustclug.org" - } - } - }, - "condition": { - "urlFilter": "ajax.googleapis.com", - "requestDomains": ["ajax.googleapis.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - }, - { - "id": 2, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { - "scheme": "https", - "host": "google-themes.proxy.ustclug.org" - } - } - }, - "condition": { - "urlFilter": "themes.googleusercontent.com", - "requestDomains": ["themes.googleusercontent.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - } -] diff --git a/extension/manifest.json b/extension/manifest.json index 8c106ef6..fd8eab9e 100644 --- a/extension/manifest.json +++ b/extension/manifest.json @@ -1,11 +1,11 @@ { "name": "Replace Google CDN", - "version": "0.11.0", + "version": "0.12.0", "manifest_version": 3, "icons": { "128": "icons/128.png" }, - "description": "将 Google CDN 替换为国内镜像 v3 更新日期:2023-12-06", + "description": "将 Google CDN 替换为国内镜像 v3 更新日期:2024-07-17", "background": { "service_worker": "js/background.js", "type": "module" diff --git a/extension/rules/mirrors/ajax.googleapis.com.json b/extension/rules/mirrors/ajax.googleapis.com.json index 661435bb..59c8215d 100644 --- a/extension/rules/mirrors/ajax.googleapis.com.json +++ b/extension/rules/mirrors/ajax.googleapis.com.json @@ -27,12 +27,10 @@ "csp_report", "media", "websocket", - "other" ] } }, - { "id": 2, "priority": 100, @@ -61,12 +59,10 @@ "csp_report", "media", "websocket", - "other" ] } }, - { "id": 3, "priority": 100, @@ -92,12 +88,10 @@ "csp_report", "media", "websocket", - "other" ] } }, - { "id": 4, "priority": 100, @@ -123,12 +117,10 @@ "csp_report", "media", "websocket", - "other" ] } }, - { "id": 7, "priority": 90, @@ -154,12 +146,10 @@ "csp_report", "media", "websocket", - "other" ] } }, - { "id": 8, "priority": 90, @@ -185,12 +175,10 @@ "csp_report", "media", "websocket", - "other" ] } }, - { "id": 9, "priority": 90, @@ -216,7 +204,6 @@ "csp_report", "media", "websocket", - "other" ] } @@ -246,12 +233,10 @@ "csp_report", "media", "websocket", - "other" ] } }, - { "id": 11, "priority": 90, @@ -277,38 +262,6 @@ "csp_report", "media", "websocket", - - "other" - ] - } - }, - - { - "id": 12, - "priority": 90, - "action": { - "type": "redirect", - "redirect": { - "regexSubstitution": "https://cdn.staticfile.org/\\1/\\2/\\3" - } - }, - "condition": { - "regexFilter": "^https?://ajax\\.googleapis\\.com/ajax/libs/(.*?)/([\\.|\\d]*?)/(.*?)", - "requestDomains": ["ajax.googleapis.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - "other" ] } diff --git a/extension/rules/mirrors/cdnjs.cloudflare.com.json b/extension/rules/mirrors/cdnjs.cloudflare.com.json index bf33264f..782270d6 100644 --- a/extension/rules/mirrors/cdnjs.cloudflare.com.json +++ b/extension/rules/mirrors/cdnjs.cloudflare.com.json @@ -91,40 +91,6 @@ ] } }, - { - "id": 5, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { - "scheme": "https", - "host": "cdnjs.sourcegcdn.com" - } - } - }, - "condition": { - "urlFilter": "|http*://cdnjs.cloudflare.com", - "requestDomains": ["cdnjs.cloudflare.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - }, - { "id": 6, "priority": 90, diff --git a/extension/rules/mirrors/code.jquery.com-ui.json b/extension/rules/mirrors/code.jquery.com-ui.json index efa04c11..7c58260c 100644 --- a/extension/rules/mirrors/code.jquery.com-ui.json +++ b/extension/rules/mirrors/code.jquery.com-ui.json @@ -60,38 +60,6 @@ ] } }, - - { - "id": 3, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "regexSubstitution": "https://cdn.staticfile.org/jqueryui/\\1/\\2" - } - }, - "condition": { - "regexFilter": "^https?://code\\.jquery\\.com/ui/(\\d{1,4}\\.\\d{1,4}\\.\\d{1,4})/(.*?)", - "requestDomains": ["code.jquery.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - }, - { "id": 4, "priority": 100, diff --git a/extension/rules/mirrors/code.jquery.com.json b/extension/rules/mirrors/code.jquery.com.json index ae884925..3681e0e2 100644 --- a/extension/rules/mirrors/code.jquery.com.json +++ b/extension/rules/mirrors/code.jquery.com.json @@ -24,43 +24,10 @@ "csp_report", "media", "websocket", - "other" ] } }, - - { - "id": 2, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "regexSubstitution": "https://cdn.staticfile.org/jquery/\\1/jquery\\2" - } - }, - "condition": { - "regexFilter": "^https?://code.jquery.com/jquery-(\\d{1,4}\\.\\d{1,4}\\.\\d{1,4})(.*?)", - "requestDomains": ["code.jquery.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - - "other" - ] - } - }, - { "id": 3, "priority": 100, @@ -86,12 +53,10 @@ "csp_report", "media", "websocket", - "other" ] } }, - { "id": 4, "priority": 100, @@ -117,12 +82,10 @@ "csp_report", "media", "websocket", - "other" ] } }, - { "id": 5, "priority": 101, @@ -148,7 +111,6 @@ "csp_report", "media", "websocket", - "other" ] } diff --git a/extension/rules/mirrors/fonts.googleapis.com.json b/extension/rules/mirrors/fonts.googleapis.com.json index 7d19c7ab..07f38755 100644 --- a/extension/rules/mirrors/fonts.googleapis.com.json +++ b/extension/rules/mirrors/fonts.googleapis.com.json @@ -96,39 +96,6 @@ "media", "websocket", - "other" - ] - } - }, - { - "id": 6, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { - "scheme": "https", - "host": "fonts.sourcegcdn.com" - } - } - }, - "condition": { - "urlFilter": "|http*://fonts.googleapis.com", - "requestDomains": ["fonts.googleapis.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - "other" ] } diff --git a/extension/rules/mirrors/gravatar.com.json b/extension/rules/mirrors/gravatar.com.json index eb757eed..8551b63a 100644 --- a/extension/rules/mirrors/gravatar.com.json +++ b/extension/rules/mirrors/gravatar.com.json @@ -72,45 +72,6 @@ "media", "websocket", - "other" - ] - } - }, - - { - "id": 5, - "priority": 100, - "action": { - "type": "redirect", - "redirect": { - "transform": { - "scheme": "https", - "host": "avatar.sourcegcdn.com" - } - } - }, - "condition": { - "urlFilter": "|http*://*.gravatar.com", - "requestDomains": [ - "secure.gravatar.com", - "www.gravatar.com", - "cn.gravatar.com", - "en.gravatar.com" - ], - "resourceTypes": [ - "main_frame", - "sub_frame", - "stylesheet", - "script", - "image", - "font", - "object", - "xmlhttprequest", - "ping", - "csp_report", - "media", - "websocket", - "other" ] } diff --git a/extension/rules/mirrors/imgur.com.json b/extension/rules/mirrors/imgur.com.json index 7aa743a2..416de8d7 100644 --- a/extension/rules/mirrors/imgur.com.json +++ b/extension/rules/mirrors/imgur.com.json @@ -40,26 +40,5 @@ "xmlhttprequest" ] } - }, - { - "id": 4, - "priority": 1, - "action": { - "type": "redirect", - "redirect": { - "regexSubstitution": "https://pic1.xuehuaimg.com/proxy/\\1" - } - }, - "condition": { - "regexFilter": "^https?://(.*?)", - "requestDomains": ["imgur.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "image", - "object", - "xmlhttprequest" - ] - } } ] diff --git a/extension/rules/mirrors/lh3.googleusercontent.com.json b/extension/rules/mirrors/lh3.googleusercontent.com.json index d008c332..f79ba562 100644 --- a/extension/rules/mirrors/lh3.googleusercontent.com.json +++ b/extension/rules/mirrors/lh3.googleusercontent.com.json @@ -40,26 +40,5 @@ "xmlhttprequest" ] } - }, - { - "id": 3, - "priority": 1, - "action": { - "type": "redirect", - "redirect": { - "regexSubstitution": "https://pic1.xuehuaimg.com/proxy/\\1" - } - }, - "condition": { - "regexFilter": "^https?://(.*?)", - "requestDomains": ["lh3.googleusercontent.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "image", - "object", - "xmlhttprequest" - ] - } } ] diff --git a/extension/rules/rules-default-domains-helper.json b/extension/rules/rules-default-domains-helper.json index 031c5405..9a1ef293 100644 --- a/extension/rules/rules-default-domains-helper.json +++ b/extension/rules/rules-default-domains-helper.json @@ -1,28 +1,4 @@ [ - { - "action": { - "requestHeaders": [ - { - "header": "referer", - "operation": "remove" - } - ], - "type": "modifyHeaders" - }, - "condition": { - "requestDomains": ["pic1.xuehuaimg.com"], - "resourceTypes": [ - "main_frame", - "sub_frame", - "image", - "object", - "xmlhttprequest" - ], - "urlFilter": "https://pic1.xuehuaimg.com/proxy/" - }, - "id": 1, - "priority": 1 - }, { "id": 2, "priority": 1, diff --git a/public-cdn.md b/public-cdn.md index 64208b93..81861705 100644 --- a/public-cdn.md +++ b/public-cdn.md @@ -3,19 +3,15 @@ 1. [烧饼博客 前端 CDNJS 库及 Google Fonts、Ajax 和 Gravatar 国内加速服务](https://u.sb/css-cdn/) 1. [360 奇舞团](https://cdn.baomitu.com/) 1. [又拍云](http://jscdn.upai.com/) -1. [BootCDN](https://www.bootcdn.cn/) 1. [字节跳动静态资源公共库](http://cdn.bytedance.com/) 1. [Microsoft Ajax Content Delivery Network](https://docs.microsoft.com/en-us/aspnet/ajax/cdn/overview) 1. [jsdelivr](https://www.jsdelivr.com/) 1. [unpkg](https://unpkg.com/) 1. [cloudflare ](https://cdnjs.com/) 1. [google libraries cn](https://developers.google.cn/speed/libraries) -1. [七牛静态库 Staticfile CDN](http://staticfile.org/) -1. [~极客族公共加速服务~](https://cdn.geekzu.org/cached.html) 1. [CDNJS 南方科技大学](https://mirrors.sustech.edu.cn/help/cdnjs.html) 1. [CDNJS mirror list ](https://mirrorz.org/list/cdnjs) -1. [公共 CDN 静态资源加速服务 7ED Services ](https://www.7ed.net/start/public-cdn.html) -1. [AHDark](https://www.sourcegcdn.com/) +1. [公共 CDN 静态资源加速服务 7ED Services (use.sevencdn.com )](https://www.7ed.net/start/public-cdn.html) 1. [中科大反向代理列表如下:](https://mirrors.ustc.edu.cn/) > ajax.googleapis.com ajax.proxy.ustclug.org @@ -25,3 +21,10 @@ > fonts.gstatic.com fonts.gstatic.cn > fonts.googleapis.com fonts.googleapis.cn + +## 不可用的 资源库 + +1. [~极客族公共加速服务~](https://cdn.geekzu.org/cached.html) +1. [~AHDark~](https://www.sourcegcdn.com/) +1. [~BootCDN~](https://www.bootcdn.cn/) +1. [~静态库 Staticfile CDN~](http://staticfile.org/) diff --git a/tools/README.md b/tools/README.md index cbde91f5..55a1c391 100644 --- a/tools/README.md +++ b/tools/README.md @@ -70,7 +70,7 @@ bash extension/tools/chromium.sh bash tools/download-firefox-latest.sh # 下载指定版本firefox -bash tools/download-firefox.sh 121.0b6 +bash tools/download-firefox.sh 129.0b4 ``` @@ -93,12 +93,22 @@ chromium --proxy-pac-url="http://127.0.0.1:8000/proxy.pac" --host-resolver-rul ``` -## 拨测工具测试地址 +## 格式化代码 -```text +```shell + +bash tools/format-code.sh + + +``` + +## npm install 指定源 + +```bash + +npm install --registry=https://registry.npmjs.org/ -https://fonts.googleapis.cn/css?family=Google+Sans +npm install --registry=https://registry.npmmirror.com -https://fonts.gstatic.cn/s/roboto/v30/KFOlCnqEu92Fr1MmEU9fBBc4.woff2 ``` diff --git a/tools/download-chromium-extension.sh b/tools/download-chromium-extension.sh index 666d2e6e..6bcf3824 100644 --- a/tools/download-chromium-extension.sh +++ b/tools/download-chromium-extension.sh @@ -46,9 +46,6 @@ done mkdir -p chromium-extensions cd ${__PROJECT__}/var/chromium-extensions -# google translate -extension_id=aapbdbdomjkkjkaonfhkkikfgjllcleb -file_name='google-translate' # Clear Site Data extension_id=aihgofjefdlhpnmeakpnjjeajofpcbhj diff --git a/tools/download-firefox.sh b/tools/download-firefox.sh index a865f7c5..92c7dd1b 100644 --- a/tools/download-firefox.sh +++ b/tools/download-firefox.sh @@ -51,7 +51,7 @@ OS=$(uname -s) ARCH=$(uname -m) echo "${OS}_${ARCH}" -FIREFOX_VERSION=121.0b6 +FIREFOX_VERSION=129.0b4 if [ -n "$1" ]; then FIREFOX_VERSION="$1" diff --git a/tools/format-code.sh b/tools/format-code.sh index 22e2b0f7..4800a9d4 100644 --- a/tools/format-code.sh +++ b/tools/format-code.sh @@ -10,6 +10,8 @@ __PROJECT__=$(readlink -f ${__DIR__}/../) cd ${__PROJECT__} +npm install --registry=https://registry.npmmirror.com + npx prettier --write . -cd ${__DIR__} \ No newline at end of file +cd ${__DIR__} diff --git a/tools/net-detect.md b/tools/net-detect.md index 96ef2aed..16e1582d 100644 --- a/tools/net-detect.md +++ b/tools/net-detect.md @@ -2,3 +2,59 @@ 1. [网络拨测工具](https://zijian.aliyun.com/detect/http) 1. [网站诊断分析工具](https://zijian.aliyun.com/) + +## 拨测例子 + +打开拨测站点: https://zijian.aliyun.com/detect/http 输入如下任意地址 + +```text + +https://fonts.googleapis.cn/css?family=Google+Sans + +https://fonts.gstatic.cn/s/roboto/v30/KFOlCnqEu92Fr1MmEU9fBBc4.woff2 + + +dig fonts.googleapis.cn +dig fonts.gstatic.cn + +``` + +### 拨测完毕,打开浏览器控制台 执行如下代码,提取到 IP 地址 + +```javascript +{ + let list = []; + let table_body = document.querySelectorAll( + "#app .show-detection-data .ping-result-area .next-table-body table tbody tr" + ); + table_body.forEach((value, key, parent) => { + let row = []; + value.querySelectorAll("td").forEach((v) => { + console.log(v.innerText); + row.push(v.innerText); + }); + list.push(row); + }); + // 优化,做的就是 查找和排序 + //取第二列数据 + let new_list = list.map((value) => { + return value[1]; + }); + //去重 + let ip_list = Array.from(new Set(new_list)); + ip_list = ip_list.filter((item) => item !== null && item !== ""); + console.log(ip_list); + + //下载文件 + let blob = new Blob([JSON.stringify(ip_list)], { type: "application/json" }); + let url = window.URL.createObjectURL(blob); + let a = document.createElement("a"); + a.style.display = "none"; + a.href = url; + a.download = "google-ip-" + new Date().toISOString() + ".txt"; + a.click(); + setTimeout(function () { + window.URL.revokeObjectURL(url); + }, 3000); +} +```