From 605bdf1f96474e58b7ea2f1af4475a392829968a Mon Sep 17 00:00:00 2001 From: root Date: Mon, 27 Apr 2026 22:26:22 +0800 Subject: [PATCH] fix: correct Clash Verge Rev deep link parameter order to v1.8.0.7 --- config/version | 2 +- ...026-04-27-fix-clash-verge-import-scheme.md | 24 +++++++++++++++++++ web/html/user.html | 2 +- 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 docs/Tasktracking/2026-04-27-fix-clash-verge-import-scheme.md diff --git a/config/version b/config/version index 078e5177..0b5214e8 100644 --- a/config/version +++ b/config/version @@ -1 +1 @@ -v1.8.0.6 +v1.8.0.7 diff --git a/docs/Tasktracking/2026-04-27-fix-clash-verge-import-scheme.md b/docs/Tasktracking/2026-04-27-fix-clash-verge-import-scheme.md new file mode 100644 index 00000000..08e723b2 --- /dev/null +++ b/docs/Tasktracking/2026-04-27-fix-clash-verge-import-scheme.md @@ -0,0 +1,24 @@ +# Task Record + +Date: 2026-04-27 +Related Module: web/html/user.html +Change Type: Fix + +## Background +The "Desktop" quick import button on `/panel/user` uses the `clash-verge://install-config` URL scheme to trigger subscription import in Clash Verge Rev. However, the Clash Verge Rev `extract_subscription_url` function in `scheme.rs` performs a raw string search for `url=` and takes everything to the end of the query string as the subscription URL. When `name` parameter is placed after `url`, the extracted URL becomes corrupted (e.g., `ENCODED_URL&name=ENCODED_NAME`), causing import to fail. + +## Changes +- `web/html/user.html`: Swapped parameter order in `quickImportDesktop` method from `url=...&name=...` to `name=...&url=...`, ensuring the `url` parameter is the last query parameter so Clash Verge Rev correctly extracts only the subscription URL. + +## Impact +- Only affects the Desktop (Clash Verge Rev) quick import button behavior +- No API, database, or build impact +- Android and iOS buttons unchanged + +## Verification +- `gofmt -l -w .` passed with no changes to Go files +- `go vet ./...` passed +- HTML change is a one-line JS string change, no build needed + +## Risks And Follow-Up +- Clash Verge Rev may fix their URL parsing in a future version; this parameter order remains compatible either way diff --git a/web/html/user.html b/web/html/user.html index c10e4081..e99605db 100644 --- a/web/html/user.html +++ b/web/html/user.html @@ -235,7 +235,7 @@ this.$message.warning('{{ i18n "pages.user.noSubscription" }}'); return; } - window.location.href = 'clash-verge://install-config?url=' + encodeURIComponent(url) + '&name=' + encodeURIComponent(this.username || 'Subscription'); + window.location.href = 'clash-verge://install-config?name=' + encodeURIComponent(this.username || 'Subscription') + '&url=' + encodeURIComponent(url); }, formatExpiryTime(timestamp) { if (timestamp <= 0) return '{{ i18n "unlimited" }}';