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

Resolve relative urls using HTML <base> #114

Open
OmgImAlexis opened this issue Mar 10, 2018 · 4 comments
Open

Resolve relative urls using HTML <base> #114

OmgImAlexis opened this issue Mar 10, 2018 · 4 comments

Comments

@OmgImAlexis
Copy link
Contributor

Is there a reason this only uses the current URL for resolving relative URLs instead of using the <base> element?

https://github.com/unshiftio/url-parse/blob/master/index.js#L235

Ref: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base

@lpinca
Copy link
Member

lpinca commented Mar 11, 2018

I don't think there is a reason. Support for the <base> element should be easy to add.
cc: @3rd-Eden

@3rd-Eden
Copy link
Member

Can we get away with it without adding platform specific code for it?

@OmgImAlexis
Copy link
Contributor Author

Since it should be available via document.baseURI could you not just add it onto the if statement? if (document && document.baseURI){}

@lpinca
Copy link
Member

lpinca commented Mar 13, 2018

It should be sufficient to add document && document.baseURI here.

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

3 participants