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

推荐订阅源

博客园_首页
Security Archives - TechRepublic
Security Archives - TechRepublic
Application and Cybersecurity Blog
Application and Cybersecurity Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
C
CERT Recently Published Vulnerability Notes
S
Security @ Cisco Blogs
S
Security Affairs
D
Darknet – Hacking Tools, Hacker News & Cyber Security
L
Lohrmann on Cybersecurity
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Hacker News: Ask HN
Hacker News: Ask HN
Forbes - Security
Forbes - Security
H
Heimdal Security Blog
A
Arctic Wolf
NISL@THU
NISL@THU
P
Proofpoint News Feed
W
WeLiveSecurity
S
Schneier on Security
AI
AI
Schneier on Security
Schneier on Security
N
News and Events Feed by Topic
L
LINUX DO - 最新话题
Cisco Talos Blog
Cisco Talos Blog
AWS News Blog
AWS News Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
Know Your Adversary
Know Your Adversary
Scott Helme
Scott Helme
V
Vulnerabilities – Threatpost
Cyberwarzone
Cyberwarzone
I
Intezer
S
Securelist
Help Net Security
Help Net Security
Microsoft Security Blog
Microsoft Security Blog
量子位
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
小众软件
小众软件
Last Week in AI
Last Week in AI
Jina AI
Jina AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
WordPress大学
WordPress大学
罗磊的独立博客
月光博客
月光博客
雷峰网
雷峰网
A
About on SuperTechFans
The GitHub Blog
The GitHub Blog
T
The Blog of Author Tim Ferriss
MongoDB | Blog
MongoDB | Blog
大猫的无限游戏
大猫的无限游戏
博客园 - 司徒正美
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events

博客园 - 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; }

}

//-->