Skip to content

Instantly share code, notes, and snippets.

@stowball
Last active April 17, 2022 19:09
Show Gist options
  • Star 33 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save stowball/4617428 to your computer and use it in GitHub Desktop.
Save stowball/4617428 to your computer and use it in GitHub Desktop.
Microsoft's stop-gap solution to fix IE 10 & 11's viewport on Windows Phone 8. I've also added another condition so it won't run on other browsers that spoof the user agent. Details: http://mattstow.com/responsive-design-in-ie10-on-windows-phone-8.html
(function() {
if ("-ms-user-select" in document.documentElement.style && navigator.userAgent.match(/IEMobile/)) {
var msViewportStyle = document.createElement("style");
msViewportStyle.appendChild(
document.createTextNode("@-ms-viewport{width:auto!important}")
);
document.getElementsByTagName("head")[0].appendChild(msViewportStyle);
}
})();
@citizenfix
Copy link

Lumia Spoofer is the best forever now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment