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

Side by Side Diff: components/security_interstitials/core/browser/resources/interstitial_v2.js

Issue 1416273004: Change the interstitial bypass keyword (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698