Skip to content

Add Wildcard Host Matching - #25

Draft
smashedr wants to merge 14 commits into
masterfrom
wildcards
Draft

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

@jcarstens-cnlbz

jcarstens-cnlbz commented Aug 12, 2026

Copy link
Copy Markdown

I tested your build in Chrome. Works fine, thank you.
My use case are staging and dev domains that start with "staging." or "dev.", mostly with the same credentials.
Currently I have to add them as staging.*.*. Would be nice if I could just use staging.* or something like staging.**. Or regex syntax staging\..*

@smashedr

Copy link
Copy Markdown
Member Author

I tested your build in Chrome. Works fine, thank you. My use case are staging and dev domains that start with "staging." or "dev.", mostly with the same credentials. Currently I have to add them as staging.*.*. Would be nice if I could just use staging.* or something like staging.**. Or regex syntax staging\..*

Thanks for the update. I have been preoccupied lately, but will have some time to re-visit this sometime this week/weekend.

I will review/update this PR and try to get a release out then.

@smashedr

Copy link
Copy Markdown
Member Author

@jcarstens-cnlbz

Currently I have to add them as staging.*.*. Would be nice if I could just use staging.* or something like staging.**. Or regex syntax staging\..*

I am adding the Double Star feature, where ** matches 1 or more segments.
I have not had time to test this, things keep coming up, but it is here: #28

I uploaded a build of the double star PR here if you are bored and want to test it: #28 (comment)

Otherwise, I will try to test over the weekend, and merge it into this PR.

@smashedr
smashedr marked this pull request as draft August 15, 2026 03:46
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

2 participants