Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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:
(function() {
if ("-ms-user-select" in && navigator.userAgent.match(/IEMobile/)) {
var msViewportStyle = document.createElement("style");

This comment has been minimized.

Copy link

@zeronull0null zeronull0null commented Apr 1, 2016

It worths mentioning that this code will not work on "Edge browser - Windows 10 Mobile" since the user-agent is now different:

Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Nokia; Lumia 520) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Mobile Safari/537.36 Edge/13.10570

Needs a little bit of tweaking to make it work.

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