Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

更新README.md 和 完善命令行模式浏览器加载扩展 #193

Merged
merged 62 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
7583cfa
update
jingjingxyk Dec 4, 2023
0e2516c
test install firefox
jingjingxyk Dec 4, 2023
7adc719
test install firefox
jingjingxyk Dec 4, 2023
0d60c38
test install firefox
jingjingxyk Dec 4, 2023
0a5e907
test install firefox
jingjingxyk Dec 4, 2023
4861998
test install firefox
jingjingxyk Dec 4, 2023
6acf4d4
update
jingjingxyk Dec 4, 2023
a554fc2
update
jingjingxyk Dec 4, 2023
e80207b
test
jingjingxyk Dec 4, 2023
361a010
test
jingjingxyk Dec 4, 2023
e242f81
test
jingjingxyk Dec 4, 2023
74851aa
test
jingjingxyk Dec 4, 2023
222c749
test
jingjingxyk Dec 4, 2023
4641f0a
test
jingjingxyk Dec 4, 2023
00c0418
test
jingjingxyk Dec 4, 2023
ae67a41
test
jingjingxyk Dec 4, 2023
2c276f1
查询firefox 安抓选项
jingjingxyk Dec 4, 2023
b0976e5
查询firefox 安抓选项
jingjingxyk Dec 4, 2023
5d19269
查询firefox 安抓选项
jingjingxyk Dec 4, 2023
955a3b2
查询firefox 安抓选项
jingjingxyk Dec 4, 2023
8e0207b
查询firefox 安抓选项
jingjingxyk Dec 4, 2023
e27aecc
查询firefox 安装选项
jingjingxyk Dec 4, 2023
66d414d
查询firefox 安装选项
jingjingxyk Dec 4, 2023
17fc7ed
workflow show var folder
jingjingxyk Dec 4, 2023
188c34c
fix workflow error
jingjingxyk Dec 4, 2023
5850051
workflow show firefox version
jingjingxyk Dec 4, 2023
3b656ab
workflow show firefox version
jingjingxyk Dec 4, 2023
3f15915
workflow show firefox version
jingjingxyk Dec 4, 2023
705d6ae
workflow show firefox version
jingjingxyk Dec 4, 2023
327f91d
workflow show firefox version
jingjingxyk Dec 4, 2023
6606847
workflow show firefox version
jingjingxyk Dec 4, 2023
f1c4daa
workflow show firefox version
jingjingxyk Dec 4, 2023
fb7c2f1
workflow show firefox version
jingjingxyk Dec 4, 2023
85fe698
workflow show browser version
jingjingxyk Dec 4, 2023
ae6537a
workflow show browser version
jingjingxyk Dec 4, 2023
93cbead
workflow show browser version
jingjingxyk Dec 4, 2023
e091c93
完善命令行启动chromium 和 firefox
jingjingxyk Dec 4, 2023
003e6d7
完善命令行启动chromium 和 firefox
jingjingxyk Dec 4, 2023
89543a0
完善命令行启动chromium 和 firefox
jingjingxyk Dec 4, 2023
ec35938
完善命令行启动chromium 和 firefox
jingjingxyk Dec 4, 2023
188b04d
完善命令行启动chromium 和 firefox
jingjingxyk Dec 4, 2023
99c32f1
完善命令行启动chromium 和 firefox
jingjingxyk Dec 4, 2023
6918928
完善命令行启动chromium 和 firefox
jingjingxyk Dec 4, 2023
9b8a436
完善命令行启动chromium 和 firefox
jingjingxyk Dec 4, 2023
575972c
完善命令行启动chromium 和 firefox
jingjingxyk Dec 4, 2023
e1b50cc
完善命令行启动chromium 和 firefox
jingjingxyk Dec 4, 2023
0e266cb
update README.md
jingjingxyk Dec 4, 2023
df1643c
update README.md
jingjingxyk Dec 4, 2023
527f068
update README.md
jingjingxyk Dec 4, 2023
186ea72
update README.md
jingjingxyk Dec 4, 2023
08ba97a
update README.md
jingjingxyk Dec 4, 2023
34299b6
update README.md
jingjingxyk Dec 4, 2023
a533d73
update release-archive.sh
jingjingxyk Dec 4, 2023
6aee1be
update README.md
jingjingxyk Dec 4, 2023
7f980e2
改进打包,排除与扩展无关的文件
jingjingxyk Dec 4, 2023
b114e4c
优化打包
jingjingxyk Dec 4, 2023
a62a533
调整与扩展辅助脚本
jingjingxyk Dec 4, 2023
2f2ade0
auto test chromium
jingjingxyk Dec 4, 2023
ea53e69
auto test
jingjingxyk Dec 4, 2023
a62864e
update toos/README.md
jingjingxyk Dec 4, 2023
07124ef
update chromium-auto-test.sh
jingjingxyk Dec 4, 2023
c1ec91c
update chromium-auto-test.sh
jingjingxyk Dec 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 36 additions & 6 deletions .github/workflows/linux-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:

jobs:
linux-x86_64:
if: github.ref == 'refs/heads/dev' || github.ref_name == 'dev'
if: 1
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -54,30 +54,60 @@ jobs:

sudo apt install -y supervisor socat

- name: Cache Chromium
uses: actions/cache@v3
with:
path: |
install-build-deps.py
${{ github.workspace }}/var/chrome-linux.zip
${{ github.workspace }}/var/chrome-linux
key: ${{ runner.os }}-x86_64-chromium

- name: Prepare Chromium Run Environment
run: |
set -x

curl https://chromium.googlesource.com/chromium/src/+/refs/heads/main/build/install-build-deps.sh?format=TEXT | base64 --decode > install-build-deps.sh
curl https://chromium.googlesource.com/chromium/src/+/refs/heads/main/build/install-build-deps.py?format=TEXT | base64 --decode > install-build-deps.py
# curl https://chromium.googlesource.com/chromium/src/+/refs/heads/main/build/install-build-deps.sh?format=TEXT | base64 --decode > install-build-deps.sh
test -f install-build-deps.py || curl https://chromium.googlesource.com/chromium/src/+/refs/heads/main/build/install-build-deps.py?format=TEXT | base64 --decode > install-build-deps.py
sudo python3 install-build-deps.py

- name: Download Chromium
run: |
set -x
bash tools/download-chromium.sh
if [ ! -f ${{ github.workspace }}/var/chrome-linux.zip ] ; then
bash tools/download-chromium.sh
fi

- name: Cache Firefox
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/var/firefox.tar.bz2
${{ github.workspace }}/var/firefox/
key: ${{ runner.os }}-x86_64-firefox

- name: Download Firefox
shell: bash
run: |
set -x
bash tools/download-firefox.sh
if [ ! -f ${{ github.workspace }}/var/firefox.tar.bz2 ] ; then
bash tools/download-firefox.sh
fi

- name: show browser version
shell: bash
run: |
ls -lha var/
var/chrome-linux/chrome --version
var/firefox/firefox --version

- name: Chromium Load Extension
run: |
set -x
# bash tools/chromium.sh --xvfb
# bash tools/chromium.sh --headless
nohup bash tools/chromium.sh --xvfb &
sleep 15
bash tools/chromium-auto-test.sh

- name: Firefox Load Extension
run: |
Expand Down
33 changes: 30 additions & 3 deletions .github/workflows/macos-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:

jobs:
macos-x86_64:
if: github.ref == 'refs/heads/dev' || github.ref_name == 'dev'
if: 1
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -44,13 +44,40 @@ jobs:
run: |
set -x

- name: Cache Chromium
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/var/chrome-mac.zip
${{ github.workspace }}/var/chrome-mac
key: ${{ runner.os }}-x86_64-chromium

- name: Download Chromium
run: |
set -x
bash tools/download-chromium.sh
if [ ! -f ${{ github.workspace }}/var/chrome-mac.zip ] ; then
bash tools/download-chromium.sh
fi

- name: Cache Firefox
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/var/firefox.dmg
${{ github.workspace }}/var/firefox/
key: ${{ runner.os }}-x86_64-firefox

- name: Download Firefox
shell: bash
run: |
set -x
bash tools/download-firefox.sh
if [ ! -f ${{ github.workspace }}/var/firefox.dmg ] ; then
bash tools/download-firefox.sh
fi

- name: show browser version
shell: bash
run: |
ls -lha var/
var/chrome-mac/Chromium.app/Contents/MacOS/Chromium --version
var/firefox/Firefox.app/Contents/MacOS/firefox --version
97 changes: 72 additions & 25 deletions .github/workflows/windows-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:

jobs:
windows:
if: github.ref == 'refs/heads/dev' || github.ref_name == 'dev'
if: 1
runs-on: windows-latest
steps:
- name: Prepare git
Expand All @@ -25,45 +25,92 @@ jobs:
run: |
ipconfig /all

- name: Cache Chromium
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}\var\chrome-win.zip
${{ github.workspace }}\var\chrome-win
key: ${{ runner.os }}-x86_64-chromium

- name: Download Chromium
shell: bash
run: |
set -x
bash tools/download-chromium.sh
if [ ! -f var/chrome-win.zip ] ; then
bash tools/download-chromium.sh
fi

- name: Cache Firefox
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}\var\firefox.exe
key: ${{ runner.os }}-x86_64-firefox

- name: Download Firefox
shell: bash
run: |
set -x
bash tools/download-firefox.sh

# https://www.msys2.org/docs/ci/
# https://github.com/marketplace/actions/setup-msys2
- uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: git mingw-w64-ucrt-x86_64-gcc
if [ ! -f var/firefox.exe ] ; then
bash tools/download-firefox.sh
fi

- name: CI-Build
shell: msys2 {0}
- name: install firefox
shell: cmd
run: |
DIR
ECHO %CD%

:: msiexec /package /qn "%CD%\var\firefox.msi"
:: var\firefox.exe /?
:: start var\firefox.exe /S

:: 静默安装 firefox
var\firefox.exe /A /S
timeout /T 30 /NOBREAK

:: show firefox install directory
DIR "C:\Program Files\Mozilla Firefox"

:: show firefox version
"C:\Program Files\Mozilla Firefox\firefox.exe" --version

- name: show browser version
shell: cmd
run: |
echo 'Running in MSYS2!'

echo "C:\\msys64\\usr\\bin" >> $GITHUB_PATH
echo "C:\\msys64\\mingw64\\bin" >> $GITHUB_PATH
echo "PKG_CONFIG_PATH=/mingw64/lib/pkgconfig" >> $GITHUB_ENV

- name: test powershell use msys2
shell: powershell
run: msys2 -c 'uname -a'
DIR var
:: var\chrome-win\chrome.exe --version
"C:\Program Files\Mozilla Firefox\firefox.exe" --version

- name: test cmd use msys2
shell: cmd
run: msys2 -c 'uname -a'
# https://www.msys2.org/docs/ci/
# https://github.com/marketplace/actions/setup-msys2
# - uses: msys2/setup-msys2@v2
# with:
# msystem: UCRT64
# update: false
# install: git mingw-w64-ucrt-x86_64-gcc
#
# - name: CI-Build
# shell: msys2 {0}
# run: |
# echo 'Running in MSYS2!'
#
# echo "C:\\msys64\\usr\\bin" >> $GITHUB_PATH
# echo "C:\\msys64\\mingw64\\bin" >> $GITHUB_PATH
# echo "PKG_CONFIG_PATH=/mingw64/lib/pkgconfig" >> $GITHUB_ENV
#
# - name: test powershell use msys2
# shell: powershell
# run: msys2 -c 'uname -a'
#
# - name: test cmd use msys2
# shell: cmd
# run: msys2 -c 'uname -a'

- name: Test
shell: cmd
run: |
REM change CHCP to UTF-8
@chcp 65001>nul
echo foo=bar >> %GITHUB_OUTPUT%
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extension/tools/git-clean-file-history.sh
extension/tools/local-deploy.sh

extension/web-backup/
extension/rules/example-no-use/backup/
extension/rules/example/backup/


tools/download-chromium-extension-backup.sh
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG-v2-x.x.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## [公共 CDN 静态资源库](public-cdn.md)

## CHANGELOG for v2 0.10.17 [2023-02-09 13:01:00 +0800]
## CHANGELOG for v2 0.10.17 [2023-12-05 00:49:00 +0800]

> 1. 格式化代码

Expand Down
5 changes: 3 additions & 2 deletions Privacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The following privacy notice shall provide you with a general overview about the

## What kind of personal data do we process?

While using our products: Library Sniffer (automatically, except for Issue Reporter)
While using our products: ReplaceGoogleCDN (automatically, except for Issue Reporter)

1. Extension updates, subscription downloads, emergency notifications: Browser versionExtension versionOperating systemDate of last updateIP addressAdditionally, you may manually submit the following information about a webpage using the Issue Reporter: Browser build, if anyURLURL of referred webpage, if any, and webpage that opened the given pageBlockable itemsMatching filtersActive filter listsAccess to browser settings and installed plug-insEnabled extensions (voluntary)

Expand All @@ -14,7 +14,8 @@ While using our products: Library Sniffer (automatically, except for Issue Repor

1. Event tracking: App and/or extension versionDemographic data (gender, age)Device typeWhich platforms you are usingLocation data based on your IP address (country)Button clicks and/or navigation patternsScreens shown

## How do we collect data?
## How do we collect data? (We Do not collect data)


List of techniques and tools we use for data collection.

Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

## 原理

> 默认未启用的规则, 如需启用请到扩展选项页自行打开
> 借助浏览器提供的API,实现请求地址重定向 。[浏览器 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 资源替换为国内的:

Expand Down Expand Up @@ -146,7 +148,7 @@ https://www.jingjingxyk.com/chromium-extension/ReplaceGoogleCDN-v3.zip

```

## [declarative_net_reques 配置示例](extension/rules/README.md)
## [declarative_net_reques 规则配置示例](extension/rules/README.md)

## [测试用例](test/README.md)

Expand Down
6 changes: 3 additions & 3 deletions extension/tools/update-auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

def get_auth_data():
auth = dict()
print(project_dir+'/rules/advance-no-use/auth.json')
with open(project_dir+'/rules/advance-no-use/auth.json', mode='r', encoding='utf-8') as f:
print(project_dir+'/rules/example-advance/auth.json')
with open(project_dir+'/rules/example-advance/auth.json', mode='r', encoding='utf-8') as f:
content = f.read()
res = json.loads(content)
print(res)
Expand All @@ -17,7 +17,7 @@ def get_auth_data():


def set_auth(all_auth, latest_auth):
with(open(project_dir+'/rules/advance-no-use/auth-latest.json', mode='w')) as f:
with(open(project_dir+'/rules/example-advance/auth-latest.json', mode='w')) as f:
# f.writelines(json.dumps(all_auth))
print(all_auth[0]['action']['requestHeaders'])
for item in enumerate(all_auth[0]['action']['requestHeaders']):
Expand Down
2 changes: 1 addition & 1 deletion extension/tools/update-auth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ __ROOT__=$(
echo ${__ROOT__}


cd ${__ROOT__}/rules/advance-no-use/
cd ${__ROOT__}/rules/example-advance/

if test -f auth.json; then
des_line_number=$(grep -n 'x-auth-token' auth.json | awk -F ":" '{print $1}')
Expand Down
2 changes: 1 addition & 1 deletion extension/tools/update-domain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ __ROOT__=$(
echo ${__ROOT__}


cd ${__ROOT__}/rules/advance-no-use/
cd ${__ROOT__}/rules/example-advance/

if test -f auth.json; then
des_line_number=$(grep -n 'requestDomains' auth.json | awk -F ":" '{print $1}')
Expand Down
2 changes: 1 addition & 1 deletion extension/tools/update-punycode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ old_punycode='_xn--3px_'
new_punycode='_xn--fiq_'


nums=$(grep -rl "$old_punycode" ${__ROOT__}/rules/advance/*.json | wc -l)
nums=$(grep -rl "$old_punycode" ${__ROOT__}/rules/example-advance/*.json | wc -l)

if test $nums -gt 0; then

Expand Down
5 changes: 3 additions & 2 deletions release-archive-v3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ zip -r ${__DIR__}/dist/ReplaceGoogleCDN-v3-chromium.zip . \
-x "node_modules/*" \
-x "tools/*" \
-x "_metadata/*" \
-x "rules/advance-no-use/*" \
-x "rules/example-no-use/backup/*" \
-x "rules/example-advance/*" \
-x "rules/example/*" \
-x "background-page.html" \
-x "screenshot/*" \
-x "test/*" \
-x "web/*" \
Expand Down
8 changes: 6 additions & 2 deletions release-archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ __DIR__=$(
)
cd ${__DIR__}

test -d extension/_metadata/ && rm -rf extension/_metadata/

mkdir -p dist/
cd ${__DIR__}/dist

test -f ReplaceGoogleCDN-v2.zip && rm -f ReplaceGoogleCDN-v2.zip
test -f ReplaceGoogleCDN-v3.zip && rm -f ReplaceGoogleCDN-v3.zip


cd ${__DIR__}/extension

# 打包 manifest v3 支持chromium 内核系列
Expand All @@ -23,8 +26,9 @@ zip -r ../dist/ReplaceGoogleCDN-v3.zip . \
-x "node_modules/*" \
-x "tools/*" \
-x "_metadata/*" \
-x "rules/advance-no-use/*" \
-x "rules/example-no-use/backup/*" \
-x "rules/example-advance/*" \
-x "rules/example/*" \
-x "background-page.html" \
-x "screenshot/*" \
-x "test/*" \
-x "web/*" \
Expand Down
Loading