Microsoft Edge Chromium Dynamically Changes Its User Agent

As of now, Microsoft is releasing daily updates to the Canary Channel, and weekly updates to the Dev Channel of their newest Chromium-based Microsoft Edge app. Surprisingly, the browser can change its user agent line dynamically according to the rules it downloads from a special web site.

As you may already know, Microsoft Edge, the default web browser of Windows 10, is moving to a Chromium-compatible web engine in the Desktop version. Microsoft explains that the intention behind this move is to create better web compatibility for customers and less fragmentation for web developers. Microsoft has already made a number of contributions to the Chromium project, helping to port the project to Windows on ARM. The company promises to contribute more to the Chromium project.

Microsoft Edge Download Page

Also, Microsoft is enhancing the browser by adding features which were exclusive to the classic version of the app, including features like Read Aloud and Microsoft Translator.

New research by Bleeping Computer reveals that Edge Chromium can change its user agent string depending on a condition. A set of such conditions the browser downloads from the following URL:

https://config.edge.skype.com/config/v1/Edge/75.0.131.0?osname=win&channel=dev&clientId=[id]&osver=10.0.18875&osarch=x86_64&osring=WIF&osedition=professional&ostelemetrylevel=full

The server returns a JSON configuration file with a variety of options for Edge. One of its sections is a domain-related user agent, that allows Edge to dynamically change its user agent for specific web sites.

See the EdgeDomainActions section of the configuration:

{  
   "EdgeDomainActions":{  
      "user_agent_override":{  
         "version":1,
         "policies":[  
            {  
               "name":"EdgeUA",
               "type":"partialReplacement",
               "value":"AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/18.17763"
            },
            {  
               "name":"ChromeUA",
               "type":"edgeTokenReplacement",
               "value":""
            }
         ],
         "applications":[  
            {  
               "domain":"netflix.com",
               "applied_policy":"EdgeUA"
            },
            {  
               "domain":"facebook.com",
               "applied_policy":"ChromeUA"
            },
            {  
               "domain":"messenger.com",
               "applied_policy":"ChromeUA"
            },
            {  
               "domain":"hbonow.com",
               "applied_policy":"EdgeUA"
            },
            {  
               "domain":"hbogo.com",
               "applied_policy":"EdgeUA"
            },
            {  
               "domain":"napster.com",
               "applied_policy":"EdgeUA"
            },
            {  
               "domain":"sling.com",
               "applied_policy":"EdgeUA"
            },
            {  
               "domain":"stan.com.au",
               "applied_policy":"ChromeUA"
            }
         ]
      }
   },
}

This section tells the Edge browser that for certain sites it should impersonate Google Chrome (ChromeUA) or the original Microsoft Edge (EdgeUA).

For netflix.com, hbonow.com, hbogo.com, napster.com, and sling.com, the new Edge will pretend to be the original Edge and switch its user agent to:

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

For facebook.com, messenger.com, and stan.com.au it will pretend to be Google Chrome and use the following user agent:

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

For all other domains not listed, it will use the default user agent, which is:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3763.0 Safari/537.36 Edg/75.0.131.0

So, the Edge browser can enable features like PlayReady DRM on sites like Netflix using its default 'Edge' user agent string, and get better performance and compatibility on web sites that work better in Chrome, including Facebook and YouTube, by changing its user agent in addition to the Blink engine of Chromium.

Source: Bleeping Computer.

1 thought on “Microsoft Edge Chromium Dynamically Changes Its User Agent

  1. phil

    why Microsoft switching from edge to chromium??

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *