Repository navigation
Conversation
A port of the WHATWG URL Pattern standard with no external package: the pattern tokenizer and parser, regex and pattern-string generation, the constructor-string parser, and component canonicalization on top of a small WHATWG URL parser (System.Uri is not WHATWG-compliant). Custom regexp groups are translated from JavaScript "v"-flag syntax to .NET Regex. Vendors the WPT urlpatterntestdata.json (BSD-3-Clause) and runs it as a browser-free data-driven test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Playwright for Node accepts a
URLPatternwherever it takes a URL matcher, and .NET has nothing like it. This addsPlaywrightNative.URLPattern, a port of the WHATWG URL Pattern standard with no external package: constructors from a pattern string orURLPatternInit, the component getters,HasRegExpGroups,TestandExec.Matching needs WHATWG URL canonicalization, and
System.Uridoes not follow those rules, so a small WHATWG URL parser (hosts, IDNA, IPv4/IPv6, paths, percent-encoding) lives next to it. Custom regexp groups are written in JavaScript "v"-flag syntax and are translated to .NETRegex, keeping JS group numbering.The WPT
urlpatterntestdata.jsonis vendored with its BSD license and runs as a browser-free test: 365 of 369 entries pass. Three entries call the JS API in ways the .NET overloads can't express, and one differs only in an empty optional group reading""instead ofundefined.This is part 1 of 3. Routing and waits/expect wiring follow.
Part of #42, #47, #28
🤖 Generated with Claude Code