Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
6471f71
[skip ci] sync locale
github-actions[bot] Apr 25, 2023
a77dc6a
Merge pull request #250 from FirefoxBar/dev-locale
sylingd Apr 25, 2023
848bda4
fix: use auto-complete
sylingd Jun 19, 2023
1892e48
fix: auto-complete width
sylingd Jun 19, 2023
16abe17
feat: init content switcher
sylingd Jun 19, 2023
aaa0da2
fix: package.json
sylingd Jun 19, 2023
6fb9010
feat: switcher
sylingd Jun 20, 2023
1b66f96
feat: add switcher
sylingd Jun 20, 2023
238430c
fix: styles
sylingd Jun 20, 2023
e0013a8
fix: switcher key
sylingd Jun 20, 2023
9e7f226
feat: add switch toast
sylingd Jun 20, 2023
4131c37
fix: edit quick popup
sylingd Jun 20, 2023
e47a4b1
[skip ci] sync locale
github-actions[bot] Jun 20, 2023
1de11b4
Merge pull request #254 from FirefoxBar/dev-locale
sylingd Jun 20, 2023
e136549
[skip ci] sync locale
github-actions[bot] Jun 20, 2023
31a3ecc
Merge pull request #255 from FirefoxBar/dev-locale
sylingd Jun 20, 2023
83db6b4
feat: support auto record history
sylingd Jul 3, 2024
431b297
feat: add small size
sylingd Jul 3, 2024
d55decc
feat: add quick edit
sylingd Jul 3, 2024
5e388a7
chore: update locale
sylingd Jul 3, 2024
d2fa3c6
feat: enhance option page
sylingd Jul 4, 2024
d890ddf
feat: enhance group switch
sylingd Jul 4, 2024
e408093
chore: add group switch message
sylingd Jul 4, 2024
b463d38
docs: fix typo #243
sylingd Jul 4, 2024
a869cbc
chore: help text size
sylingd Jul 4, 2024
b36ba80
[skip ci] sync locale
github-actions[bot] Jul 4, 2024
e43faf5
Merge pull request #265 from FirefoxBar/dev-locale
sylingd Jul 4, 2024
86f41d2
chore: update workflow
sylingd Jul 4, 2024
9894d21
fix: record history
sylingd Jul 4, 2024
4ebdd19
chore: disable auto open
sylingd Jul 4, 2024
be67a73
chore: add logo
sylingd Jul 4, 2024
517d002
fix: collapse detect
sylingd Jul 4, 2024
9a573dc
scripts: update workflow
sylingd Jul 10, 2024
f7d9fd5
scripts: fix token
sylingd Jul 10, 2024
1be3456
scripts: fix snapshot
sylingd Jul 10, 2024
73879e0
scripts: remove fetch
sylingd Jul 10, 2024
e976688
scripts: update release
sylingd Jul 10, 2024
f002f52
scripts: update file check
sylingd Jul 10, 2024
8e42a39
feat: init dnr
sylingd Jan 3, 2025
d80ee51
fix: remove dnr from web_request
sylingd Jan 3, 2025
b5f03ea
chore: update manifest
sylingd Jan 3, 2025
5d7978b
feat: enhance pack scripts
sylingd May 3, 2025
81d8609
feat: enhance pack scripts
sylingd May 3, 2025
bac3ce9
feat: move manifest generate into plugin
sylingd May 4, 2025
b6db49f
feat: adapt sw
sylingd May 4, 2025
bbb7006
feat: add dev check
sylingd May 5, 2025
fa1627e
fix: dnr runner
sylingd May 5, 2025
cce3ded
feat: test firefox
sylingd May 6, 2025
da41827
feat: optimize lite file size
sylingd May 6, 2025
f52c2e6
feat: optimize file size
sylingd May 6, 2025
4c79a8e
fix: cloud format
sylingd May 6, 2025
214bc3c
test: init jest
sylingd May 6, 2025
9259fc0
test: add e2e
sylingd May 17, 2025
b92598d
chore: fix upload-artifact
sylingd May 17, 2025
6f397ae
fix: pnpm
sylingd May 17, 2025
b62a603
fix: node
sylingd May 17, 2025
3e79aaa
fix: test
sylingd May 17, 2025
d82ef8d
tests: support firefox auto test
sylingd May 17, 2025
9472afb
chore: build
sylingd Jul 14, 2025
d8274f9
fix: sw issues
sylingd Jul 14, 2025
e40f591
fix: options page
sylingd Jul 14, 2025
8782e1c
feat: optimize DNR rule id generate
sylingd Jul 15, 2025
c271b6f
chore: update docs
sylingd Jul 15, 2025
293bd88
chore: update help url
sylingd Jul 15, 2025
25663ee
chore: deploy docs
sylingd Jul 15, 2025
c98831a
docs: fix home link
sylingd Jul 15, 2025
31a2473
fix: update workflows
sylingd Jul 15, 2025
6639e25
chore: fix workflow
sylingd Jul 15, 2025
070d9e0
chore: fix workflow
sylingd Jul 15, 2025
8bd71de
chore: fix workflow
sylingd Jul 15, 2025
52eeddb
[skip ci] sync locale
github-actions[bot] Jul 15, 2025
0b40a1f
Merge pull request #266 from FirefoxBar/dev-locale
sylingd Jul 15, 2025
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
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ coverage/
# 忽略文件
**/*-min.js
**/*.min.js
build.config.js
142 changes: 114 additions & 28 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,47 @@ concurrency:
cancel-in-progress: true

jobs:
check_changes:
runs-on: ubuntu-24.04
outputs:
locale_changed: ${{ steps.filter.outputs.locale }}
docs_changed: ${{ steps.filter.outputs.docs }}
src_changed: ${{ steps.filter.outputs.src }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: dorny/paths-filter@v3
id: filter
with:
base: ${{ github.ref_name }}
filters: |
locale:
- 'locale/**'
docs:
- 'docs/**'
src:
- 'src/**'
- 'public/**'
- 'scripts/**'
- 'tests/**'
- 'build.config.js'
- 'pnpm-lock.yaml'

build:
runs-on: ubuntu-latest
needs: check_changes
runs-on: ubuntu-24.04
if: ${{ needs.check_changes.outputs.src_changed == 'true' }}
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 7
version: 9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
Expand All @@ -32,41 +61,60 @@ jobs:
TOKEN: ${{ secrets.SNAPSHOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: node ./scripts/get-snapshot-version.mjs
- name: Build
run: npm run build
- name: Build Firefox v2
run: npm run build:firefox_v2
- name: Build Firefox v3
run: npm run build:firefox_v3
- name: Build Chrome v2
run: npm run build:chrome_v2
- name: Build Chrome v3
run: npm run build:chrome_v3
- name: Upload bundle
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
path: |
dist_chrome_v2
dist_chrome_v3
dist_firefox_v2
dist_firefox_v3
- name: Upload bundle analyze
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bundle-analyze
path: temp/bundle-analyze.html
- name: Publish snapshot
env:
AMO_KEY: ${{ secrets.AMO_KEY }}
AMO_SECRET: ${{ secrets.AMO_SECRET }}
CRX_PRIV_KEY: ${{ secrets.CRX_PRIV_KEY }}
run: npm run pack -- --platform=xpi,crx
- name: Upload snapshot release
uses: actions/upload-artifact@v3
with:
name: release
path: |
temp/release
!temp/release/*-id.txt
- name: Test
run: |
php -S 0.0.0.0:8899 -t $GITHUB_WORKSPACE/tests/simple-server &
sleep 5
npm run test:e2e
# - name: Publish snapshot
# env:
# AMO_KEY: ${{ secrets.AMO_KEY }}
# AMO_SECRET: ${{ secrets.AMO_SECRET }}
# CRX_PRIV_KEY: ${{ secrets.CRX_PRIV_KEY }}
# CRX_PRIV_KEY_V3: ${{ secrets.CRX_PRIV_KEY_V3 }}
# PACK_PLATFORM: xpi,crx
# run: npm run pack
# - name: Upload snapshot release
# uses: actions/upload-artifact@v3
# with:
# name: release
# path: |
# temp/release
# !temp/release/*-id.txt

sync-locale:
runs-on: ubuntu-latest
needs: check_changes
runs-on: ubuntu-24.04
if: ${{ needs.check_changes.outputs.locale_changed == 'true' }}
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Sort
Expand All @@ -78,3 +126,41 @@ jobs:
folder: locale
clean: false
commit-message: '[skip ci] sync locale'

build-docs:
needs: check_changes
runs-on: ubuntu-24.04
if: ${{ needs.check_changes.outputs.docs_changed == 'true' }}
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
cd $GITHUB_WORKSPACE/docs
pnpm i
- name: Build
run: |
cd $GITHUB_WORKSPACE/docs
npm run build
cp $GITHUB_WORKSPACE/scripts/www/* $GITHUB_WORKSPACE/docs/dist/
- name: Deploy Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
command: pages deploy docs/dist --project-name=${{ vars.CF_PAGE_NAME }} --branch=dev
- name: Deploy EdgeOne Pages
env:
EO_PAGE_TOKEN: ${{ secrets.EO_PAGE_TOKEN }}
run: |
npm i -g edgeone
edgeone pages deploy $GITHUB_WORKSPACE/docs/dist -n ${{ vars.EO_PAGE_NAME }} -t $EO_PAGE_TOKEN -e preview
67 changes: 34 additions & 33 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,36 @@ concurrency:
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
check_changes:
runs-on: ubuntu-24.04
outputs:
docs_changed: ${{ steps.filter.outputs.docs }}
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 7
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm i --frozen-lockfile
- name: Build
run: npm run build
- name: Upload bundles
uses: actions/upload-artifact@v3
with:
name: dist
path: dist
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: dorny/paths-filter@v3
id: filter
with:
base: ${{ github.ref_name }}
filters: |
docs:
- 'docs/**'

build-docs:
runs-on: ubuntu-latest
needs: check_changes
runs-on: ubuntu-24.04
if: ${{ needs.check_changes.outputs.docs_changed == 'true' }}
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 7
version: 9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
Expand All @@ -57,8 +51,15 @@ jobs:
cd $GITHUB_WORKSPACE/docs
npm run build
cp $GITHUB_WORKSPACE/scripts/www/* $GITHUB_WORKSPACE/docs/dist/
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
- name: Deploy Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
branch: gh-pages
folder: docs/dist
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
command: pages deploy docs/dist --project-name=${{ vars.CF_PAGE_NAME }}
- name: Deploy EdgeOne Pages
env:
EO_PAGE_TOKEN: ${{ secrets.EO_PAGE_TOKEN }}
run: |
npm i -g edgeone
edgeone pages deploy $GITHUB_WORKSPACE/docs/dist -n ${{ vars.EO_PAGE_NAME }} -t $EO_PAGE_TOKEN
19 changes: 13 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ concurrency:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 7
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -27,18 +27,25 @@ jobs:
cache: 'pnpm'
- name: Install dependencies
run: pnpm i --frozen-lockfile
- name: Build
run: npm run build
- name: Build Firefox v2
run: npm run build:firefox_v2
- name: Build Firefox v3
run: npm run build:firefox_v3
- name: Build Chrome v2
run: npm run build:chrome_v2
- name: Build Chrome v3
run: npm run build:chrome_v3
- name: Upload bundles
uses: actions/upload-artifact@v3
with:
name: dist
path: dist
path: dist_firefox_v3
- name: Pack
env:
AMO_KEY: ${{ secrets.AMO_KEY }}
AMO_SECRET: ${{ secrets.AMO_SECRET }}
CRX_PRIV_KEY: ${{ secrets.CRX_PRIV_KEY }}
CRX_PRIV_KEY_V3: ${{ secrets.CRX_PRIV_KEY_V3 }}
CWS_CLIENT_ID: ${{ secrets.CWS_CLIENT_ID }}
CWS_CLIENT_SECRET: ${{ secrets.CWS_CLIENT_SECRET }}
CWS_TOKEN: ${{ secrets.CWS_TOKEN }}
Expand All @@ -50,5 +57,5 @@ jobs:
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SERVER_TOKEN: ${{ secrets.SNAPSHOT_TOKEN }}
TOKEN: ${{ secrets.SNAPSHOT_TOKEN }}
run: npm run release
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,7 @@ encrypt
.eslintcache
.vscode
temp

manifest.json
dist_*
tests/**/config.json
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
registry=https://registry.npmjs.org/
auto-install-peers=false
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
build/
tests/
demo/
.ice/
coverage/
Expand Down
16 changes: 12 additions & 4 deletions build.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
const targetBrowser = String(process.env.TARGET_BROWSER) || 'firefox_v3';

const envConfigs = require('./scripts/browser-config/browser.config.json');
const { getDistDir } = require('./scripts/browser-config/get-path');

const env = envConfigs[targetBrowser];

module.exports = {
externals: {
react: 'React',
'react-dom': 'ReactDOM',
define: {
...env,
IS_DEV: process.env.NODE_ENV === 'development',
TARGET_BROWSER: targetBrowser,
},
outputDir: 'dist',
outputDir: getDistDir(targetBrowser),
outputAssetsPath: {
js: 'assets/js',
css: 'assets/css',
Expand Down
19 changes: 1 addition & 18 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
# Header Editor Docs

A static site base on [dumi](https://d.umijs.org).

## Development

```bash
# install dependencies
$ pnpm install

# start dev server
$ pnpm start

# build docs
$ pnpm run build
```

## LICENSE

MIT
2
2 changes: 1 addition & 1 deletion docs/docs/guide/custom-function.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ if (val.includes('utm_source')) {

## Modify the request headers and response headers

The incoming parameter is an array containing all header information in the following format: `[{"name: "header name", "value": "header content"} ... ]`.
The incoming parameter is an array containing all header information in the following format: `[{"name": "header name", "value": "header content"} ... ]`.

Because JS pass the Object by reference, the custom function does not need any return value, only need to modify the incoming parameters to take effect. For example, this code will add ` HE/2.0.0` to the end of `User-Agent`:

Expand Down
Loading