Skip to content

Instantly share code, notes, and snippets.

@jacobrossi
Last active April 1, 2018 01:29
  • Star 16 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jacobrossi/c9699b27df2f4e97c0bd to your computer and use it in GitHub Desktop.
Windows 10 Technical Preview IE UA String
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0
@paulirish
Copy link

@crswll
Copy link

crswll commented Jan 22, 2015

Holy smokes.

@getify
Copy link

getify commented Jan 22, 2015

Hoooray! More nails in the coffin of UA strings, which need to die. This UA string is a hilarious troll on the rest of the market. I love it!

@Fyrd
Copy link

Fyrd commented Jan 22, 2015

One thing I find interesting is that IE itself somehow never made it in this list. Maybe something to strive for in the future. ;)

@bevacqua
Copy link

Love how it mentions every user agent ever, except for IE.

@antpaw
Copy link

antpaw commented Jan 22, 2015

How does it helps to kill UA string?
IE10 = true if UAstring.has? 'Mozilla', 'Chrome', 'Safari'
I'm sure this is what some peoples code soon going to be look like.

@casarock
Copy link

Well, Opera has something like this:
Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36 OPR/15.0.1147.153

Spartan has less... ;)

@3rd-Eden
Copy link

IE = /(Edge)\/(\d+)\.(\d+)/.exec(navigator.userAgent)

Not that hard to detect tbh.

@triblondon
Copy link

Is this the UA that will be emitted by the browser currently known as project Spartan?

Whatever that turns out to be, it's a fair bet it will start with "Mozilla", avoid including the string "msie" and likely toss in some magic strings like "chrome" and "safari".

This is hurting the web. There are good, sensible reasons for wanting to positively ID a browser, not least of which is the fact that feature detection doesn't mean the feature works. There are thousands of cases of feature detects combined with a sneaky (and usually flawed) UA sniff to exclude a browser which passes the feature detect but is known to have a buggy implementation. There are proprietary extensions that only exist in some browsers. There are implementations that are buggy in some browsers in very specific ways. There are features implemented to early specs which then changed.

With the polyfill service I and others are trying to provide a tool to correct those flaws, but you cannot do it accurately or efficiently with feature detection. We would all benefit if user agents were to honestly, accurately and uniquely identify themselves.

I understand that some sites have bad UA parsing. But Microsoft has had similar problems before and found a solution: when IE8 fixed bugs sites were relying on, you added compatibility mode, and a blacklist of sites that would get switched to it by default. Here we need the same thing. So why not be the trailblazer here: set the new UA string to "/" and start a crowd sourced database of sites that require a legacy UA. Have the browser refresh its list daily or weekly.

@nickshanks
Copy link

@triblondon I presume the IE team have found that the number of extant sites where a naïve UA detection is used as feature selector outweigh (both in quantity and collective importance) the sites that use both explicit feature detection coupled with UA identification to exclude UAs with buggy implementations. That this hinders future interoperable website development is a trade-off they were willing to make.

@dmethvin
Copy link

See this blog post for the crazy UA sniffing that some people do, it's no wonder IE has to mention every browser. I agree that UA sniffing can be useful in some cases. The problem is that it's been abused and the abusers have fled the scene or just don't care, leaving the browser makers to fiddle with the UA so their users don't suffer. It's not just IE either, Chrome mentions Gecko and Safari for a reason.

@victor-homyakov
Copy link

Microsoft, be brave! Let it be just "Edge/12.0"!

@silverwind
Copy link

Can we please deprecate UA strings already?

Here's wishing for something like navigator.supports.{feature}.

@dmethvin
Copy link

@jrodl3r
Copy link

jrodl3r commented Jan 22, 2015

@silverwind after they all agree to do that in 10 years, IE will insist on using different feature-names.

@lyzadanger
Copy link

There must be an entire field emerging: UA archaeologist and lore historian. It's starting to read like the "begats" in the bible. All browsers much connect their lineage to Konqueror or face a lack-of-legitimacy crisis!

@jacobrossi
Copy link
Author

Honestly, we wish the UA string didn't have to be a lie (though it is in every browser). If the tokens were stickers, then this looks like the back of my laptop! But this is a necessary change. The reality is that our new engine, EdgeHTML, is further diverged from Trident than even Blink is from WebKit. So its necessary to break those ties. Further, today's web just doesn't work unless you have these other tokens. The number of broken sites is in the thousands. It's also worth noting that we're not just slapping these in there with nothing else, these Chrome/Safari tokens come along with a commitment to quadruple down on interoperability with these browsers. To date, we've made over 3000 interop fixes and are adding over 40 new standards, which makes these tokens more of a white lie. :) Rest assured we understand sniffing is occasionally necessary. We will absolutely maintain a way to confidently identify the new engine (look for "Edge").

@z-eh
Copy link

z-eh commented Jan 24, 2015

It's just some compatibility issue. We have Mozilla keyword in IE UA string from IE9, now we also have Safari and AppleWebKit for the same. :)

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