Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: jquery/jquery.client.js

Issue 4123001: Modified chrome pageload extension (Closed) Base URL: http://src.chromium.org/svn/trunk/src/chrome/common/extensions/docs/examples/extensions/benchmark/
Patch Set: '' Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « jquery/jquery-ui-1.8.4.custom.min.js ('k') | jquery/jquery.flot.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 (function() {
2
3 var BrowserDetect = {
4 init: function () {
5 this.browser = this.searchString(this.dataBrowser) || "A n unknown browser";
6 this.version = this.searchVersion(navigator.userAgent)
7 || this.searchVersion(navigator.appVersion)
8 || "an unknown version";
9 this.OS = this.searchString(this.dataOS) || "an unknown OS";
10 },
11 searchString: function (data) {
12 for (var i=0;i<data.length;i++) {
13 var dataString = data[i].string;
14 var dataProp = data[i].prop;
15 this.versionSearchString = data[i].versionSearch || data[i].identity;
16 if (dataString) {
17 if (dataString.indexOf(data[i].subString ) != -1)
18 return data[i].identity;
19 }
20 else if (dataProp)
21 return data[i].identity;
22 }
23 },
24 searchVersion: function (dataString) {
25 var index = dataString.indexOf(this.versionSearchString) ;
26 if (index == -1) return;
27 return parseFloat(dataString.substring(index+this.versio nSearchString.length+1));
28 },
29 dataBrowser: [
30 {
31 string: navigator.userAgent,
32 subString: "Chrome",
33 identity: "Chrome"
34 },
35 { string: navigator.userAgent,
36 subString: "OmniWeb",
37 versionSearch: "OmniWeb/",
38 identity: "OmniWeb"
39 },
40 {
41 string: navigator.vendor,
42 subString: "Apple",
43 identity: "Safari",
44 versionSearch: "Version"
45 },
46 {
47 prop: window.opera,
48 identity: "Opera"
49 },
50 {
51 string: navigator.vendor,
52 subString: "iCab",
53 identity: "iCab"
54 },
55 {
56 string: navigator.vendor,
57 subString: "KDE",
58 identity: "Konqueror"
59 },
60 {
61 string: navigator.userAgent,
62 subString: "Firefox",
63 identity: "Firefox"
64 },
65 {
66 string: navigator.vendor,
67 subString: "Camino",
68 identity: "Camino"
69 },
70 { // for newer Netscapes (6+)
71 string: navigator.userAgent,
72 subString: "Netscape",
73 identity: "Netscape"
74 },
75 {
76 string: navigator.userAgent,
77 subString: "MSIE",
78 identity: "Explorer",
79 versionSearch: "MSIE"
80 },
81 {
82 string: navigator.userAgent,
83 subString: "Gecko",
84 identity: "Mozilla",
85 versionSearch: "rv"
86 },
87 { // for older Netscapes (4-)
88 string: navigator.userAgent,
89 subString: "Mozilla",
90 identity: "Netscape",
91 versionSearch: "Mozilla"
92 }
93 ],
94 dataOS : [
95 {
96 string: navigator.platform,
97 subString: "Win",
98 identity: "Windows"
99 },
100 {
101 string: navigator.platform,
102 subString: "Mac",
103 identity: "Mac"
104 },
105 {
106 string: navigator.userAgent,
107 subString: "iPhone",
108 identity: "iPhone/iPod"
109 },
110 {
111 string: navigator.platform,
112 subString: "Linux",
113 identity: "Linux"
114 }
115 ]
116
117 };
118
119 BrowserDetect.init();
120
121 window.$.client = { os : BrowserDetect.OS, browser : BrowserDetect.brows er };
122
123 })();
OLDNEW
« no previous file with comments | « jquery/jquery-ui-1.8.4.custom.min.js ('k') | jquery/jquery.flot.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698