Intent to prototype and ship: URL.canParse()

113 views
Skip to first unread message

CanadaHonk

unread,
May 31, 2023, 6:51:01 PM5/31/23
to dev-pl...@mozilla.org
As of today, I intend to turn on the URL.canParse() function by default on all platforms. It has not been developed behind a flag, rather being enabled by default in the implementation patch as it is a low-risk feature. No other browsers ship or implement the feature at this time.

Summary:
The URL.canParse() function allows for checking if a URL can be parsed, instead of having to wrap a URL constructor in a try catch block. This is more performant and serves for a better developer experience.

Bug: https://bugzil.la/1823354
Specification: https://url.spec.whatwg.org/#dom-url-canparse
Standards body: WHATWG URL
Platform coverage: All

Preference: None
DevTools bug: None
Standards position: None

Other browsers:
- Blink: Not shipped or implemented. Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1425839
- WebKit: Implemented, shipped in Safari TP 168.

Web platform tests: https://wpt.fyi/results/url/url-statics-canparse.any.html
Reply all
Reply to author
Forward
0 new messages