Skip to content

fix(bulk): expand encoded subscriptions pasted into the URL box - #9

Merged
Hidden-Node merged 8 commits into
Hidden-Node:mainfrom
pofa10:advisor/033-url-box-b64-bulk
Oct 17, 2026
Merged

Hidden-Node merged 8 commits into
Hidden-Node:mainfrom
pofa10:advisor/033-url-box-b64-bulk

Conversation

@pofa10

@pofa10 pofa10 commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Problem

The bulk URL box ("Paste VLESS or Trojan URL(s)...") parses one line at a time. A pasted base64 subscription is a single line, so it reached parseProxyURLSingle(), whose base64 fallback recursed on the decoded body -- and new URL() strips line breaks, collapsing every config into the first one's remark. A 28-config subscription was enhanced as a single VLESS link ("bulk paste shows one link").

The Subscription sub-tab decoder (extractSubConfigs) already handled the blob correctly; this fixes the URL box path.

Changes

  • pure.js: add expandBulkLines() so the URL box expands a whole-body, line-wrapped or per-line base64 body into its config lines first.
  • pure.js: guard parseProxyURLSingle() so a decoded value carrying more than one config line returns an error instead of silently merging (covers the Chain Builder and any other caller).
  • script.js: both URL boxes (ECH + Fragment) use expandBulkLines().
  • tests: 8 new cases (expandBulkLines shapes + the parse guard).
  • README.md / README-fa.md: note the URL box accepts encoded subscriptions.

Verification

  • node --check pure.js, node --check script.js: clean
  • node --test tests/pure.test.js: 163/163 pass (was 155)
  • jsdom, real page: a pasted 28-config blob now yields 28 enhanced URLs in both the ECH and Fragment URL boxes; plain-list and Subscription flows unchanged.

pofa10 and others added 8 commits October 16, 2026 12:57
The bulk URL box parses one line at a time. A pasted base64 subscription is a
single line, so it reached parseProxyURLSingle(), whose base64 fallback recursed
on the decoded body -- and new URL() strips line breaks, collapsing every config
into the first one's remark. A 28-config subscription was enhanced as a single
VLESS link ("bulk paste shows one link").

- pure.js: add expandBulkLines() so the URL box expands a whole-body,
  line-wrapped or per-line base64 body into its config lines first.
- pure.js: guard parseProxyURLSingle() so a decoded value carrying more than one
  config line returns an error instead of silently merging (covers the Chain
  Builder and any other caller).
- script.js: both URL boxes (ECH + Fragment) use expandBulkLines().
- tests: 8 new cases (expandBulkLines shapes + the parse guard).
- README.md / README-fa.md: note the URL box accepts encoded subscriptions.

Gates: node --check pure.js, node --check script.js, node --test
tests/pure.test.js -> 163/163 pass. jsdom: the pasted 28-config blob now yields
28 enhanced URLs in both the ECH and Fragment URL boxes.
@Hidden-Node
Hidden-Node merged commit ead3e27 into Hidden-Node:main Oct 17, 2026
2 checks passed
@pofa10
pofa10 deleted the advisor/033-url-box-b64-bulk branch October 18, 2026 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants