OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var fileXHREnabled = function() { | 5 var fileXHREnabled = function() { |
6 var xhr = new XMLHttpRequest(); | 6 var xhr = new XMLHttpRequest(); |
7 try { | 7 try { |
8 xhr.onreadystatechange = function() {}; | 8 xhr.onreadystatechange = function() {}; |
9 xhr.onerror = function() {}; | 9 xhr.onerror = function() {}; |
10 xhr.open("GET", "nothing.xml", true); | 10 xhr.open("GET", "nothing.xml", true); |
11 xhr.send(null); | 11 xhr.send(null); |
12 } catch (e) { | 12 } catch (e) { |
13 return false; | 13 return false; |
14 } | 14 } |
15 | 15 |
16 xhr.abort(); | 16 xhr.abort(); |
17 return true; | 17 return true; |
18 }(); | 18 }(); |
19 | 19 |
20 var officialURL = (function() { | 20 var officialURL = (function() { |
21 var candidates = [ | 21 var candidates = [ |
22 'http://code.google.com/chrome/extensions/', | 22 'http://code.google.com/chrome/extensions/', |
| 23 'https://code.google.com/chrome/extensions/', |
23 'http://developer.chrome.com/', | 24 'http://developer.chrome.com/', |
| 25 'https://developer.chrome.com/', |
24 | 26 |
25 // TODO(aa): Remove this one once developer.chrome.com is live. | 27 // TODO(aa): Remove this one once developer.chrome.com is live. |
26 'http://chrome-apps-doc.appspot.com/' | 28 'http://chrome-apps-doc.appspot.com/' |
27 ]; | 29 ]; |
28 for (var i = 0, url; url = candidates[i]; i++) { | 30 for (var i = 0, url; url = candidates[i]; i++) { |
29 if (location.href.indexOf(candidates[i]) == 0) | 31 if (location.href.indexOf(candidates[i]) == 0) |
30 return candidates[i]; | 32 return candidates[i]; |
31 } | 33 } |
32 return ''; | 34 return ''; |
33 })(); | 35 })(); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 }; | 100 }; |
99 } | 101 } |
100 if (currentBranch != 'stable' && currentBranch != 'beta') { | 102 if (currentBranch != 'stable' && currentBranch != 'beta') { |
101 var warning = document.getElementById('eventPageWarning'); | 103 var warning = document.getElementById('eventPageWarning'); |
102 if (warning) | 104 if (warning) |
103 warning.style.display = 'block'; | 105 warning.style.display = 'block'; |
104 } | 106 } |
105 } | 107 } |
106 } | 108 } |
107 } | 109 } |
OLD | NEW |