OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // This is the shared code for the new (Chrome 37) security interstitials. It is | 5 // This is the shared code for the new (Chrome 37) security interstitials. It is |
6 // used for both SSL interstitials and Safe Browsing interstitials. | 6 // used for both SSL interstitials and Safe Browsing interstitials. |
7 | 7 |
8 var expandedDetails = false; | 8 var expandedDetails = false; |
9 var keyPressState = 0; | 9 var keyPressState = 0; |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 function sendCommand(cmd) { | 33 function sendCommand(cmd) { |
34 window.domAutomationController.setAutomationId(1); | 34 window.domAutomationController.setAutomationId(1); |
35 window.domAutomationController.send(cmd); | 35 window.domAutomationController.send(cmd); |
36 } | 36 } |
37 | 37 |
38 /** | 38 /** |
39 * This allows errors to be skippped by typing "danger" into the page. | 39 * This allows errors to be skippped by typing "danger" into the page. |
40 * @param {string} e The key that was just pressed. | 40 * @param {string} e The key that was just pressed. |
41 */ | 41 */ |
42 function handleKeypress(e) { | 42 function handleKeypress(e) { |
43 var BYPASS_SEQUENCE = 'danger'; | 43 var BYPASS_SEQUENCE = 'badidea'; |
44 if (BYPASS_SEQUENCE.charCodeAt(keyPressState) == e.keyCode) { | 44 if (BYPASS_SEQUENCE.charCodeAt(keyPressState) == e.keyCode) { |
45 keyPressState++; | 45 keyPressState++; |
46 if (keyPressState == BYPASS_SEQUENCE.length) { | 46 if (keyPressState == BYPASS_SEQUENCE.length) { |
47 sendCommand(CMD_PROCEED); | 47 sendCommand(CMD_PROCEED); |
48 keyPressState = 0; | 48 keyPressState = 0; |
49 } | 49 } |
50 } else { | 50 } else { |
51 keyPressState = 0; | 51 keyPressState = 0; |
52 } | 52 } |
53 } | 53 } |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 }); | 183 }); |
184 } | 184 } |
185 | 185 |
186 preventDefaultOnPoundLinkClicks(); | 186 preventDefaultOnPoundLinkClicks(); |
187 setupExtendedReportingCheckbox(); | 187 setupExtendedReportingCheckbox(); |
188 setupSSLDebuggingInfo(); | 188 setupSSLDebuggingInfo(); |
189 document.addEventListener('keypress', handleKeypress); | 189 document.addEventListener('keypress', handleKeypress); |
190 } | 190 } |
191 | 191 |
192 document.addEventListener('DOMContentLoaded', setupEvents); | 192 document.addEventListener('DOMContentLoaded', setupEvents); |
OLD | NEW |