Skip to content

Add Wildcard Host Matching#25

Open
smashedr wants to merge 14 commits into
masterfrom
wildcards
Open

Add Wildcard Host Matching#25
smashedr wants to merge 14 commits into
masterfrom
wildcards

Conversation

@smashedr

@smashedr smashedr commented Jul 11, 2026

Copy link
Copy Markdown
Member

Built extensions for easy testing:
https://df.cssnr.com/raw/auto-auth-0.0.0-chrome.zip
https://df.cssnr.com/raw/auto-auth-0.0.0-firefox.zip

Wildcard Matching

Use * to match any subdomain or port in saved host patterns:

  • *.example.com matches sub.example.com but not a.b.example.com
  • example.com:* matches example.com:8080
  • *.*.com matches sub.example.com but not a.b.example.com

Each * replaces exactly one part. If multiple patterns match, the most specific one (fewest * characters) is used.

*.example.com       ✅  sub.example.com
*.example.com       ❌  a.b.example.com
*.*.com             ❌  a.b.example.com
*.example.com       ❌  example.com
example.com:*       ✅  example.com:8080
example.com:*       ✅  example.com
example.com:8080    ✅  example.com:8080
example.com:9090    ❌  example.com:8080
*.*.com             ✅  sub.example.com
example.com         ✅  example.com
*                   ❌  example.com
*.example.com:*     ✅  sub.example.com:8080
*.example.com:9090  ❌  sub.example.com:8080

Notable Changes

src/utils/hosts.ts

  • Added wildcard matching top level functions
  • Updated Hosts class with wildcard matching functions
  • Add * to the Hosts allowed keys as a new sync group
  • Overhauled validateHostname function since new URL was lazy

‎src/entrypoints/background/auth.ts‎

  • Add fallback to findBestWildcardMatch

src/entrypoints/popup/App.vue

  • Fix updating after editing/deleting

@github-actions github-actions Bot added the source Source modification label Jul 11, 2026
@smashedr smashedr linked an issue Jul 11, 2026 that may be closed by this pull request
@smashedr smashedr marked this pull request as ready for review July 14, 2026 02:58
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

source Source modification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wildcard domain matching support

1 participant