JavaScript Browser detection

Source: Internet
Author: User

Browser kernel:

The core part of the browser is called the "Renderingengine", also known as "rendering engines", which we usually call the browser kernel.

The browser kernel determines how the browser displays the contents of the page and the formatting information of the page.

Kernel classification:

1, Trident (ie kernel): The browser using the IE kernel has IE6/IE7/IE8 (Trident 4.0). IE9 (Trident 5.0). IE10 (Trident 10.0). Of course, like many domestic browsers use the IE kernel but not IE browser (Shell browser). such as: 360 Security browser (1.0-5.0 use Trident), 6.0 use trident+webkit,7.0 use Trident+blink; Cheetah Browser, roaming browser, Sogou high-speed browser, etc.

Many browsers are now called "dual-core" or "multicore", one of which uses Trident, and then adds another kernel, which is called "high-speed browser mode" domestically. Trident is used to make compatibility mode.

2, GEKCO (Firefox kernel): Firefox browser and so on.

3. Presto (early version of opera): now obsolete.

4, Webkit (Safari kernel, chrome kernel): Apple's core, is also Apple's Safari browser kernel, such as Chrome, Safari, 360 Speed browser and Sogou browser in high-speed mode using the kernel.

5, Blink: Google and Opera Software developed a browser typesetting engine, after the 28 version of Chrome, Opera 15 after use.

Typesetting engine:

1, WebCore: Apple Research and development, using WebCore's main browser is safari.

2, khtml.

JavaScript gets client information:

The navigator contains information about the browser.

Object Properties (list the more commonly used):

1. AppVersion: Returns the platform and version information of the browser.

2. Platform: Returns the name of the operating platform running the browser.

3. UserAgent: Returns the value of the user-agent header of the server sent by the client.

Each browser useragent shows:

Firefox:gecko to use the kernel, followed by version number 20100101. Firefox can also be used to determine whether Firefox browser, version number 35.0.


Opera: Different versions may result in different results:


IE9.0: Can be determined by MSIE is IE browser.


Chrome:


Safari:


Domestic browser support is not perfect:

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">



JavaScript Browser detection

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.