Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement URL.parse #277

Open
filiptronicek opened this issue Aug 27, 2024 · 0 comments
Open

Implement URL.parse #277

filiptronicek opened this issue Aug 27, 2024 · 0 comments

Comments

@filiptronicek
Copy link

About 5 months ago in whatwg/url@58acb06, the static method URL.parse was added to the spec.

Quoting from MDN:

The URL.parse() static method of the URL interface returns a newly created URL object representing the URL defined by the parameters.
If the given base URL or the resulting URL are not parsable and valid URLs, null is returned. This is an alternative to using the URL() constructor to construct a URL within a try...catch block, or using canParse() to check the parameters and returning null if the method returns false.

It seems like a useful addition to the API and has been shipped so far by Chrome and Firefox, with pending experiments from Safari and Opera.

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

No branches or pull requests

1 participant