sniff.js
2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
define(["./kernel", "./lang", "../sniff"], function(dojo, lang, has){
// module:
// dojo/_base/sniff
/*=====
return {
// summary:
// Deprecated. New code should use dojo/sniff.
// This module populates the dojo browser version sniffing properties like dojo.isIE.
};
=====*/
if(!has("host-browser")){
return has;
}
// no idea what this is for, or if it's used
dojo._name = "browser";
lang.mixin(dojo, {
// isBrowser: Boolean
// True if the client is a web-browser
isBrowser: true,
// isFF: Number|undefined
// Version as a Number if client is FireFox. undefined otherwise. Corresponds to
// major detected FireFox version (1.5, 2, 3, etc.)
isFF: has("ff"),
// isIE: Number|undefined
// Version as a Number if client is MSIE(PC). undefined otherwise. Corresponds to
// major detected IE version (6, 7, 8, etc.)
isIE: has("ie"),
// isKhtml: Number|undefined
// Version as a Number if client is a KHTML browser. undefined otherwise. Corresponds to major
// detected version.
isKhtml: has("khtml"),
// isWebKit: Number|undefined
// Version as a Number if client is a WebKit-derived browser (Konqueror,
// Safari, Chrome, etc.). undefined otherwise.
isWebKit: has("webkit"),
// isMozilla: Number|undefined
// Version as a Number if client is a Mozilla-based browser (Firefox,
// SeaMonkey). undefined otherwise. Corresponds to major detected version.
isMozilla: has("mozilla"),
// isMoz: Number|undefined
// Version as a Number if client is a Mozilla-based browser (Firefox,
// SeaMonkey). undefined otherwise. Corresponds to major detected version.
isMoz: has("mozilla"),
// isOpera: Number|undefined
// Version as a Number if client is Opera. undefined otherwise. Corresponds to
// major detected version.
isOpera: has("opera"),
// isSafari: Number|undefined
// Version as a Number if client is Safari or iPhone. undefined otherwise.
isSafari: has("safari"),
// isChrome: Number|undefined
// Version as a Number if client is Chrome browser. undefined otherwise.
isChrome: has("chrome"),
// isMac: Boolean
// True if the client runs on Mac
isMac: has("mac"),
// isIos: Number|undefined
// Version as a Number if client is iPhone, iPod, or iPad. undefined otherwise.
isIos: has("ios"),
// isAndroid: Number|undefined
// Version as a Number if client is android browser. undefined otherwise.
isAndroid: has("android"),
// isWii: Boolean
// True if client is Wii
isWii: has("wii"),
// isQuirks: Boolean
// Page is in quirks mode.
isQuirks: has("quirks"),
// isAir: Boolean
// True if client is Adobe Air
isAir: has("air")
});
return has;
});