asp.net - How to override Request.Browser on server side? -


Opera user agent "Mozilla / 5.0 (Windows NT 6.1; WOW64) Apple WebKat / 537.36 (KHML, like GECO) Chrome / Html

38.0 .2125.104 Safari / 537.36 OPR / 25.0.1614.63 "On the server side is defined as" chrome ".

I wanted to override the creation of an object request. Broser and a file "opera.browser" added to a folder "App_Browsers":

& Lt; / Identification & gt; & Lt; Capabilities & gt; & Lt; Capacity name = "browser" value = "opera" /> & Lt; Capacity name = "major version" value = "$ {major}" /> & Lt; Capacity name = "low value" value = "$ {minor}" /> & Lt; Capacity name = "type" value = "opera $ {major}" /> & Lt; Capacity name = "version" value = "$ {version}" /> & Lt; / Capabilities & gt; & Lt; / Browser & gt; & Lt; / Browsers & gt;

But Regex is not working and requests. Browser.Browser is still defined as "Chrome".

You can set user agent manually

  HttpContext.SetOverriddenBrowser ("Some Browser");  

And if you want to clear the override, just do it

  HttpContext.ClearOverriddenBrowser ();  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -