How do I check the browser type, version and if support Javascript?

Asked

Viewed 279 times

0

I need to identify the browser, the browser version and if it is enabled to run javascript. In previous versions of Asp.Net I checked Global.asax using the command Request.Browser.JavaScriptbut this command is set to [deprecated] in the new frameworks.

  • 1

    I believe you’re looking for something like https://modernizr.com/

  • window.navigator.useragent

1 answer

0

I don’t know if you have all the information, but this link here can help you a lot.

How to read browser properties and information

Ex:

System.Web.HttpBrowserCapabilitiesBase browser = Request.Browser;
        string s = "Browser Capabilities\n"
            + "Type = " + browser.Type + "\n"
            + "Name = " + browser.Browser + "\n"
            + "Version = " + browser.Version + "\n"
            + "Major Version = " + browser.MajorVersion + "\n"
            + "Minor Version = " + browser.MinorVersion + "\n"
            + "Platform = " + browser.Platform + "\n"
            + "Is Beta = " + browser.Beta + "\n"
            + "Is Crawler = " + browser.Crawler + "\n"
            + "Is AOL = " + browser.AOL + "\n"
            + "Is Win16 = " + browser.Win16 + "\n"
            + "Is Win32 = " + browser.Win32 + "\n"
            + "Supports Frames = " + browser.Frames + "\n"
            + "Supports Tables = " + browser.Tables + "\n"
            + "Supports Cookies = " + browser.Cookies + "\n"
            + "Supports VBScript = " + browser.VBScript + "\n"
            + "Supports JavaScript = " +
                browser.EcmaScriptVersion.ToString() + "\n"
            + "Supports Java Applets = " + browser.JavaApplets + "\n"
            + "Supports ActiveX Controls = " + browser.ActiveXControls
                  + "\n"
            + "Supports JavaScript Version = " +
                browser["JavaScriptVersion"] + "\n";

Browser other questions tagged

You are not signed in. Login or sign up in order to post.