Home > Web Front-end > JS Tutorial > js chrome browser judgment code_javascript skills

js chrome browser judgment code_javascript skills

WBOY
Release: 2016-05-16 18:31:08
Original
1110 people have browsed it

The early decision I gave was based on UA, which has a unique Chrome string.

Copy code The code is as follows:

var isChrome = window.navigator.userAgent.indexOf("Chrome") !== -1

Today I discovered that chrome still has some unique things. Based on them, we can make feature-based judgments.
Copy code The code is as follows:

var isChrome = window.google && window.chrome

Of these two things, the former has its local database gears, and the latter has two attributes, csi and loadTimes.
For more information, please refer to
JavaScript to determine browser type and version

Use JavaScript to determine whether the user is using IE6 or IE7
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template