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

Utilise <base> tag in goto() in case of IE11 #1034

Closed
Case09 opened this issue Dec 24, 2019 · 1 comment
Closed

Utilise <base> tag in goto() in case of IE11 #1034

Case09 opened this issue Dec 24, 2019 · 1 comment
Assignees
Labels

Comments

@Case09
Copy link

@Case09 Case09 commented Dec 24, 2019

When trying to use goto() in IE11, whole page will reload instead of navigation. As i understand this is because document.baseURI is undefined in IE11, so goto() function logic falls back to location.href = href;.

This can of course be fixed by setting document.baseURI in IE to value of <base> tag that sapper adds, but maybe this should be added in sapper code base.

In goto() definition new URL is made with
const target = select_target(new URL(href, document.baseURI)); This can maybe be changed to call function like this instead of document.baseURI directly:

function getBaseURI() {
  if (document.baseURI) return document.baseURI;
  const base = document.getElementsByTagName('base');
  if (base.length > 0) return base[0].href;
  return document.URL;
}
@Conduitry
Copy link
Member

@Conduitry Conduitry commented Sep 25, 2020

This should be fixed in 0.28.9.

@Conduitry Conduitry closed this Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.