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

Use URL instead of creating an <a> tag #7

Open
philipwalton opened this issue Aug 10, 2019 · 0 comments
Open

Use URL instead of creating an <a> tag #7

philipwalton opened this issue Aug 10, 2019 · 0 comments

Comments

@philipwalton
Copy link

All browsers that support modules also support the URL API, so I don't see any reason to use the <a> tag just to convert a relative URL to an absolute one.

Your toAbsoluteURL() function could be removed and you could update the usage as follows:

- const absURL = toAbsoluteURL(url);
+ const absURL = new URL(url, location).href;
@philipwalton philipwalton mentioned this issue Aug 10, 2019
Closed
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