Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

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

Comments

@Case09
Copy link

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

This should be fixed in 0.28.9.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants