1. Firefox
Gecko is the Firefox rendering engine. The original gecko was developed as part of a generic Mozilla browser, and the first browser to use the Gecko engine was Netscape6;
We can use the user agent detection: The following JS code:
The user agent string userAgent can implement four identification functions: String useragent
Definition
User proxy string: navigator. userAgent
The HTTP specification clearly stipulates that the browser should send a brief user proxy string,
Defined
User Agent string: navigator.useragent
The HTTP specification specifies that the browser should send a short user agent string indicating the name and version number of the browser. But in reality it is not so simple.
Development history
What is the User Agent?The Chinese name of User Agent is "User Agent" (UA). It is a special string header, which refers to an identifier provided to you by the software (software Agent) that represents User behavior. It enables the server to
1. Use window. open () to replace the pop-up window.
2. Use getbrowsertype () to determine the current browser and handle it accordingly.
Function getbrowsertype (){
VaR UA = navigator. useragent. tolowercase ();
If (UA. Match (/MSIE ([\ D.]
Some js Code, spare by yourself, master do not laugh at me. (Cross-browser basic events, browser detection, and judgment of the browser name, version number, and operating system) are very practical and convenient for your use. Interested friends
The code is as follows:
The code is as follows
Copy Code
This code is judged to include not only computer browsers, but also Android, iOS mobile phones and tablets, gaming systems
code is as
In the early days, I determined that it was based on UA. In UA, it had a unique chrome string.
CopyCodeThe Code is as follows: var ischrome = Window. Navigator. useragent. indexof ("Chrome ")! =-1
Today we found that Chrome still has some unique
Web developers, who need to use a browser for a long time, even though the WINDOWS10 Edge browser starts very fast and supports more than 110 devices, the edge supports JS-based extensions, but also removes many of the old features like Active-X. In
The decision I gave earlier was based on UA, which has a unique chrome string in UA.
Copy Code code as follows:
var ischrome = window.navigator.userAgent.indexOf ("Chrome")!==-1
Today we found that there are some unique things about
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.