Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Disable FSI/PDI isolating on IE11 #178

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/web/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ import { documentReady, getResourceLinks, getMeta } from './util';
// used to create new `MessageContext` objects for a given `lang` with selected
// builtin functions.
function createContext(lang) {
return new MessageContext(lang);
// IE11 renders FSI and PDI as mojibakes so we turn them off.
const isIE11 = navigator.userAgent.indexOf('Trident') > -1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd change that to:

const isIE = !!document.documentMode;

The less UA-sniffing the better; UA can always change while no browser should ever implement the non-standard document.documentMode.

return new MessageContext(lang, {
useIsolating: !isIE11
});
}

// Called for every named Localization declared via <link name=…> elements.
Expand Down