Detecting Microsoft's edge or spartan with javascript

Vandervals picture Vandervals · Jul 20, 2015 · Viewed 23.2k times · Source

Is the user agent for Edge or Spartan browsers known already? Can anyone tell me how to detect this browser and diferentiate it from IE in advance of its release?

Answer

Supamiu picture Supamiu · Jul 20, 2015

A simple google search found me the answer you are looking for: http://forum.piwik.org/read.php?3,125732

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0

Therefore you should match: "Edge\/\d+"