From fdd00758fb05590733bd0a2e426b56b5a45fec47 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 27 Apr 2026 22:36:18 +0800 Subject: [PATCH] fix: align Desktop quick import with official Clash Verge Rev URL scheme to v1.8.0.8 --- config/version | 2 +- ...6-04-27-fix-clash-verge-scheme-standard.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-scheme-standard.md diff --git a/config/version b/config/version index 0b5214e8..f90aee59 100644 --- a/config/version +++ b/config/version @@ -1 +1 @@ -v1.8.0.7 +v1.8.0.8 diff --git a/docs/Tasktracking/2026-04-27-fix-clash-verge-scheme-standard.md b/docs/Tasktracking/2026-04-27-fix-clash-verge-scheme-standard.md new file mode 100644 index 00000000..ae9827f0 --- /dev/null +++ b/docs/Tasktracking/2026-04-27-fix-clash-verge-scheme-standard.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 used `clash-verge://install-config` with a `name` query parameter, but Clash Verge Rev official documentation only specifies `clash://install-config?url=` with no `name` parameter. Additionally, the Clash Verge Rev `extract_subscription_url` function takes everything from `url=` to end of query string, causing corruption when extra params follow. + +## Changes +- `web/html/user.html`: Changed the Desktop quick import URL scheme from `clash-verge://install-config?name=...&url=...` to `clash://install-config?url=...`, matching the official Clash Verge Rev URL Schemes documentation exactly. Removed the undocumented `name` parameter. + +## Impact +- Only affects the Desktop (Clash Verge Rev) quick import button +- No API, database, or build impact +- Android (`clash://install-config`) and iOS (`shadowrocket://`) buttons unchanged + +## Verification +- `gofmt -l -w .` passed +- `go vet ./...` passed +- Official docs confirmed: https://www.clashverge.dev/guide/url_schemes.html specifies `clash://install-config?url=` + +## Risks And Follow-Up +- The removed `name` parameter means the imported profile in Clash Verge Rev will use the default name from the subscription response instead of the username; this can be restored if Clash Verge Rev fixes their URL parser diff --git a/web/html/user.html b/web/html/user.html index e99605db..9554768a 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?name=' + encodeURIComponent(this.username || 'Subscription') + '&url=' + encodeURIComponent(url); + window.location.href = 'clash://install-config?url=' + encodeURIComponent(url); }, formatExpiryTime(timestamp) { if (timestamp <= 0) return '{{ i18n "unlimited" }}';