惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Cisco Blogs
Cyberwarzone
Cyberwarzone
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
SecWiki News
SecWiki News
Martin Fowler
Martin Fowler
T
Tor Project blog
N
Netflix TechBlog - Medium
C
Cybersecurity and Infrastructure Security Agency CISA
V
Vulnerabilities – Threatpost
V
Visual Studio Blog
GbyAI
GbyAI
PCI Perspectives
PCI Perspectives
D
DataBreaches.Net
Jina AI
Jina AI
H
Heimdal Security Blog
云风的 BLOG
云风的 BLOG
P
Privacy International News Feed
A
About on SuperTechFans
J
Java Code Geeks
美团技术团队
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
News | PayPal Newsroom
有赞技术团队
有赞技术团队
MyScale Blog
MyScale Blog
博客园 - 司徒正美
C
Check Point Blog
T
Threat Research - Cisco Blogs
Attack and Defense Labs
Attack and Defense Labs
宝玉的分享
宝玉的分享
AI
AI
Simon Willison's Weblog
Simon Willison's Weblog
C
Cyber Attacks, Cyber Crime and Cyber Security
I
Intezer
P
Proofpoint News Feed
Blog — PlanetScale
Blog — PlanetScale
Apple Machine Learning Research
Apple Machine Learning Research
Hugging Face - Blog
Hugging Face - Blog
The Last Watchdog
The Last Watchdog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Vercel News
Vercel News
I
InfoQ
阮一峰的网络日志
阮一峰的网络日志
Cisco Talos Blog
Cisco Talos Blog
W
WeLiveSecurity
Hacker News: Ask HN
Hacker News: Ask HN
Recent Commits to openclaw:main
Recent Commits to openclaw:main
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
D
Docker
博客园 - Franky
Security Archives - TechRepublic
Security Archives - TechRepublic

博客园 - Waver

Tabbing problems in Firefox in Mac OS X [转] Data Flow Diagrams Tutorial [转] HTML Ampersand Character Codes 也谈完美跨域,JavaScript [转] Route命令使用详解[转] 使用塑料水瓶要当心 Extension Method for ENUM. Design Material Websites Summarization. - Waver How to cut through the complexity to find a solution. How to install flash player on Google Chrome browser? ADODB.Stream 对象的属性与方法 VB/VBScript读取和保存UTF-8文件方案 VB6: How To Convert UTF-8 Byte Arrays into Unicode Strings (and vice versa) Perl和OLE Automation Perl Unicode全攻略 ASP+COM 组件开发 SQL高级语法 无法去掉“关闭高级语言服务”解决方案! GCT 英语单词全部核心词汇A-Z GCT 工硕英语词汇语法
浏览器类型检测. (JavaScript) 【转】
Waver · 2009-11-01 · via 博客园 - Waver

<!--

/* OS / Browser Detect. Written by Joe McCormack. www.virtualsecrets.com */

var net_browser = 0;

function wbrowsertype() {

/*

__ net_browser flag values based on OS/Browser __

0 = Undetermined OS / Browser

17 = Undetermined OS / Browser

MAC OS:

2 = Unknown Browser

3 = Internet Explorer

4 = Safari

5 = Firefox

6 = Netscape

7 = Opera

8 = Camino

9 = Firebird

26 = Google Chrome

WINDOWS OS:

10 = Unknown Browser

11 = Internet Explorer

12 = Firefox

13 = Netscape

14 = Opera

15 = Camino

16 = Firebird

25 = Google Chrome

28 = Safari

UNKNOWN OS:

17 = Unknown Browser

18 = Safari

19 = Internet Explorer

20 = Firefox

21 = Netscape

22 = Opera

23 = Camino

24 = Firebird

27 = Google Chrome

*/

var btfound = 0; browser_detect = navigator.userAgent.toLowerCase();

if ((browser_detect.indexOf("konqueror") + 1)) { btfound = 1; net_browser = 1; }

if ((browser_detect.indexOf("mac_powerpc") + 1)) { btfound = 1; net_browser = 3; }

if (btfound == 0) {

// MAC OS

if ((browser_detect.indexOf("macintosh") + 1)) {

if ((browser_detect.indexOf("safari") + 1)) { btfound = 1; net_browser = 4; }

else if ((browser_detect.indexOf("firefox") + 1)) { btfound = 1; net_browser = 5; }

else if ((browser_detect.indexOf("netscape") + 1)) { btfound = 1; net_browser = 6; }

else if ((browser_detect.indexOf("opera") + 1)) { btfound = 1; net_browser = 7; }

else if ((browser_detect.indexOf("camino") + 1)) { btfound = 1; net_browser = 8; }

else if ((browser_detect.indexOf("firebird") + 1)) { btfound = 1; net_browser = 9; }

else if ((browser_detect.indexOf("chrome") + 1)) { btfound = 1; net_browser = 26; }

else { btfound = 1; net_browser = 2; }

}

// Windows OS

if ((browser_detect.indexOf("windows") + 1) && btfound == 0) {

if ((browser_detect.indexOf("msie") + 1)) { btfound = 1; net_browser = 11; }

else if ((browser_detect.indexOf("firefox") + 1)) { btfound = 1; net_browser = 12; }

else if ((browser_detect.indexOf("netscape") + 1)) { btfound = 1; net_browser = 13; }

else if ((browser_detect.indexOf("opera") + 1)) { btfound = 1; net_browser = 14; }

else if ((browser_detect.indexOf("camino") + 1)) { btfound = 1; net_browser = 15; }

else if ((browser_detect.indexOf("firebird") + 1)) { btfound = 1; net_browser = 16; }

else if ((browser_detect.indexOf("chrome") + 1)) { btfound = 1; net_browser = 25; }

else if ((browser_detect.indexOf("safari") + 1)) { btfound = 1; net_browser = 28; }

else { btfound = 1; net_browser = 10; }

}

// Unknown OS

if (btfound == 0) {

if ((browser_detect.indexOf("safari") + 1)) { net_browser = 18; }

else if ((browser_detect.indexOf("msie") + 1)) { net_browser = 19; }

else if ((browser_detect.indexOf("firefox") + 1)) { net_browser = 20; }

else if ((browser_detect.indexOf("netscape") + 1)) { net_browser = 21; }

else if ((browser_detect.indexOf("opera") + 1)) { net_browser = 22; }

else if ((browser_detect.indexOf("camino") + 1)) { net_browser = 23; }

else if ((browser_detect.indexOf("firebird") + 1)) { net_browser = 24; }

else if ((browser_detect.indexOf("chrome") + 1)) { net_browser = 27; }

else { net_browser = 17; }

}

}

/* In most cases, Google Chrome will behave the same as Firefox. If not you can remove these value overwrites. */

//if (net_browser == 25) { net_browser = 12; }

//else if (net_browser == 26) { net_browser = 5; }

//else if (net_browser == 27) { net_browser = 20; }

}

//-->