Skip to content

feat: 网络绕过列表支持通配符域名 - #31

Open
hottaiger wants to merge 1 commit into
fedtop:mainfrom
hottaiger:feat/restore-last-panel-tab
Open

hottaiger wants to merge 1 commit into
fedtop:mainfrom
hottaiger:feat/restore-last-panel-tab

Conversation

@hottaiger

Copy link
Copy Markdown

Closes #28

  • 支持 *.guazi.com 子域名直连,并恢复历史 %2a 编码规则
  • 自动模式 PAC 中绕过规则优先于 AutoProxy 代理规则

验证:规则测试 5/5、pnpm compile、ESLint、Prettier 通过。

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Two moderate issues remain in special-token preservation and wildcard-aware UI toggle behavior.

Review effort: Lite
Findings: None

What changed in this PR

Adds wildcard-domain support to network bypass lists, including legacy %2a compatibility and PAC bypass precedence.

Changes:

  • Normalize wildcard bypass domains.
  • Prioritize bypass rules over AutoProxy rules.
  • Add regression tests and update UI guidance.
File Summary Status
tests/​network-bypass.test.mjs Tests wildcard normalization and PAC behavior. Reviewed
src/​utils/​network.ts Implements wildcard parsing and bypass precedence. Changes required for special-token compatibility
src/​features/​popup/​NetworkPage.tsx Documents wildcard syntax and manages bypass toggles. Changes required for wildcard-aware toggling

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Wildcard normalization can broaden malformed rules and discard existing Chrome bypass tokens.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity

Open (2)

Comment thread src/utils/network.ts
Comment on lines +58 to +59
const hostname = normalizeHostPattern(url.hostname)
return hasSubdomainWildcard ? `*.${hostname.replace(/^(?:\*|%2a)\./i, '')}` : hostname
Comment thread src/utils/network.ts
Comment on lines 60 to +61
} catch {
const withoutScheme = value.replace(WILDCARD_SCHEME_RE, '').replace(URL_SCHEME_RE, '')
const host = withoutScheme.startsWith('[')
? withoutScheme.slice(0, withoutScheme.indexOf(']') + 1 || undefined)
: withoutScheme.split(/[/?#]/)[0]
return host ? normalizeHostPattern(host) : null
return null
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.

feat: 网络自动/代理模式的绕过列表支持通配符域名

2 participants