Skip to content

Commit

Permalink
update script
Browse files Browse the repository at this point in the history
  • Loading branch information
jingjingxyk committed Aug 2, 2024
1 parent 69c9175 commit 3b804f6
Show file tree
Hide file tree
Showing 19 changed files with 64 additions and 53 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,3 @@ jobs:
artifact: "dist/ReplaceGoogleCDN-v3.zip"
keys: ${{ secrets.SUBMIT_KEYS }}
# 使用参考 https://github.com/PlasmoHQ/bpp.git


2 changes: 1 addition & 1 deletion .github/workflows/macos-aarch64.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: macos-aarch64

on: [ push, pull_request ]
on: [push, pull_request]

env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
Expand Down
20 changes: 10 additions & 10 deletions CHANGELOG-v3-x.x.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
2. 变更: 将辅助工具迁移到扩展目录外
3. 变更: 将高级功能脚本、规则移动到 `experimental-features` 目录 ,

部分实验脚本迁移到 [extension-v3-test](https://github.com/jingjingxyk/extension-v3-test.git) 仓库
部分实验脚本迁移到 [extension-v3-test](https://github.com/jingjingxyk/extension-v3-test.git) 仓库

## 0.10.31 [2023-12-02 22:01:00 +0800]

1. 新增: 对 firefox

提供基础版功能,暂不提供高级功能。详情: [NDR 正则表达式 未定版 ](https://github.com/w3c/webextensions/issues/344)
提供基础版功能,暂不提供高级功能。详情: [NDR 正则表达式 未定版 ](https://github.com/w3c/webextensions/issues/344)

1. 变更: 精简打包命令
1. 变更: 使用 prettier 格式化代码
Expand All @@ -40,8 +40,8 @@
3. 新增: 准备发布 v3 1.0.0 版本
4. 变更:

修改规则`developer.android.com`,`developers.google.com`,`source.android.com`,`developers.google.com`,`source.android.com`
默认不启用
修改规则`developer.android.com`,`developers.google.com`,`source.android.com`,`developers.google.com`,`source.android.com`
默认不启用

5. 变更: 准备归档不属于扩展的目录和文件(进行中)
6. 变更: 移除 2 种不支持的规则类型 `"webtransport"`,`"webbundle"` ,实现兼容 firefox
Expand Down Expand Up @@ -214,13 +214,13 @@
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"]`
个屏蔽选项 ` ["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`
报错,添加解决方案 `extension/test/extension-v3-test/js/content-scripts/github.js`

6. test 环境 新增功能: 自定义规则第一版雏形 `extension/test/extension-v3-test/index.html`

Expand All @@ -231,21 +231,21 @@
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` 浏览器当作记事本使用
小工具中 `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":[] `
错误配置位于 `rules/rules_advance_redirect_2.json : "excludedInitiatorDomains":[] `

8. maxcdn.bootstrapcdn.com 替换为 lib.baomitu.com

Expand Down
44 changes: 22 additions & 22 deletions extension/options_ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,28 +104,28 @@ chrome.declarativeNetRequest.updateDynamicRules(

## 固定规则编号

| 规则 ID | URI | 备注 |
| :-----: | :------------------------------------------: | :--------: |
| 1 | ajax.googleapis.com | 启用 |
| 2 | fonts.googleapis.com | 启用 |
| 3 | themes.googleusercontent.com | 启用 |
| 4 | fonts.gstatic.com | 启用 |
| 5 | secure.gravatar.com | 启用 |
| 6 | maxcdn.bootstrapcdn.com/bootstrap | 启用 |
| 7 | code.jquery.com/jquery-(version)(suffix) | 启用 |
| 8 | code.jquery.com/ui/(prefix)(version)(suffix) | 启用 |
| 9 | cdnjs.cloudflare.com | 默认未启用 |
| 10 | cdn.jsdelivr.net | 启用 |
| 11 | translate.googleapis.com | 默认未启用 |
| 12 | www.gstatic.com | 默认未启用 |
| 13 | developer.android.com | 默认未启用 |
| 14 | lh3.googleusercontent.com | 默认未启用 |
| 15 | cdn.sstatic.net | 默认未启用 |
| 16 | imgur.com | 默认未启用 |
| 17 | developers.google.com | 默认未启用 |
| 18 | source.android.com | 默认未启用 |
| 19 | www.google.com/recaptcha/api.js | 启用 |
| 9999 | supper-priority-override-rule | 默认未启用 |
| 规则 ID | URI | 备注 |
|:-----:|:--------------------------------------------:|:-----:|
| 1 | ajax.googleapis.com | 启用 |
| 2 | fonts.googleapis.com | 启用 |
| 3 | themes.googleusercontent.com | 启用 |
| 4 | fonts.gstatic.com | 启用 |
| 5 | secure.gravatar.com | 启用 |
| 6 | maxcdn.bootstrapcdn.com/bootstrap | 启用 |
| 7 | code.jquery.com/jquery-(version)(suffix) | 启用 |
| 8 | code.jquery.com/ui/(prefix)(version)(suffix) | 启用 |
| 9 | cdnjs.cloudflare.com | 默认未启用 |
| 10 | cdn.jsdelivr.net | 启用 |
| 11 | translate.googleapis.com | 默认未启用 |
| 12 | www.gstatic.com | 默认未启用 |
| 13 | developer.android.com | 默认未启用 |
| 14 | lh3.googleusercontent.com | 默认未启用 |
| 15 | cdn.sstatic.net | 默认未启用 |
| 16 | imgur.com | 默认未启用 |
| 17 | developers.google.com | 默认未启用 |
| 18 | source.android.com | 默认未启用 |
| 19 | www.google.com/recaptcha/api.js | 启用 |
| 9999 | supper-priority-override-rule | 默认未启用 |

> 默认未启用的规则,如何启用?
>
Expand Down
2 changes: 1 addition & 1 deletion release-archive-v3.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -exu
__DIR__=$(
Expand Down
2 changes: 1 addition & 1 deletion tools/chromium-auto-test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -exu

Expand Down
4 changes: 2 additions & 2 deletions tools/chromium.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -exu
__DIR__=$(
Expand Down Expand Up @@ -61,7 +61,7 @@ case $OS in
*)
echo 'current script no support !'
exit 0
;;
;;
esac

test -d /tmp/${UUID} || mkdir -p /tmp/${UUID}
Expand Down
3 changes: 2 additions & 1 deletion tools/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -exu
__DIR__=$(
Expand All @@ -13,6 +13,7 @@ __PROJECT__=$(
cd ${__PROJECT__}

bash release-archive.sh
bash release-archive-v3.sh

cd ${__PROJECT__}

Expand Down
2 changes: 1 addition & 1 deletion tools/download-chromium-extension.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

if [ ! "$BASH_VERSION" ]; then
echo "Please do not use BASH to run this script ($0), just execute it directly" 1>&2
Expand Down
2 changes: 1 addition & 1 deletion tools/download-chromium.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -exu
__DIR__=$(
Expand Down
2 changes: 1 addition & 1 deletion tools/download-firefox-extension.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -ex
__DIR__=$(
Expand Down
2 changes: 1 addition & 1 deletion tools/download-firefox-latest-stable.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -ex
__DIR__=$(
Expand Down
2 changes: 1 addition & 1 deletion tools/download-firefox.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -ex
__DIR__=$(
Expand Down
13 changes: 11 additions & 2 deletions tools/firefox-web-ext.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -exu

Expand Down Expand Up @@ -42,14 +42,22 @@ case $OS in
;;
esac


profile_folder="/tmp/${UUID}"

mkdir -p $profile_folder



mkdir -p ${__PROJECT__}/var/
cd ${__PROJECT__}/var/


# python3 ${__PROJECT__}/tools/update-manifest.py firefox

## 生成支持firefox 的扩展
bash release-archive-v3.sh


# firefox web extension
# https://github.com/mdn/webextensions-examples.git

Expand All @@ -72,6 +80,7 @@ bash release-archive-v3.sh
cp -f ${__PROJECT__}/tools/prefs.js $profile_folder

# 进入扩展所在目录

cd ${__PROJECT__}/dist/ReplaceGoogleCDN-v3-firefox/

# reference https://extensionworkshop.com/documentation/develop/web-ext-command-reference/#web-ext-run
Expand Down
7 changes: 5 additions & 2 deletions tools/firefox.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -exu

Expand Down Expand Up @@ -71,6 +71,9 @@ mkdir -p ${__PROJECT__}/var/
cd ${__PROJECT__}/var/



# python3 ${__PROJECT__}/tools/update-manifest.py firefox

# firefox web extension
# https://github.com/mdn/webextensions-examples.git

Expand Down Expand Up @@ -124,4 +127,4 @@ bash run-firefox.sh


# CommandLineOptions
# https://wiki.mozilla.org/Firefox/CommandLineOptions
# https://wiki.mozilla.org/Firefox/CommandLineOptions
2 changes: 1 addition & 1 deletion tools/format-code.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/env bash
#!/usr/bin/env bash

set -exu

Expand Down
2 changes: 1 addition & 1 deletion tools/python3-env-init.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -exu
__DIR__=$(
Expand Down
2 changes: 1 addition & 1 deletion tools/update-library.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -exu

__DIR__=$(
Expand Down
2 changes: 1 addition & 1 deletion tools/web-server.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -exu

__DIR__=$(
Expand Down

0 comments on commit 3b804f6

Please sign in to comment.