1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Should match SSLBlockingPageCommands in ssl_blocking_page.cc.
6 var CMD_DONT_PROCEED = 0;
13 var keyPressState = 0;
16 return document.getElementById(o);
19 function sendCommand(cmd) {
20 window.domAutomationController.setAutomationId(1);
21 window.domAutomationController.send(cmd);
24 // This allows errors to be skippped by typing "danger" into the page.
25 function keyPressHandler(e) {
26 var sequence = 'danger';
27 if (sequence.charCodeAt(keyPressState) == e.keyCode) {
29 if (keyPressState == sequence.length) {
30 sendCommand(CMD_PROCEED);
38 function sharedSetup() {
39 document.addEventListener('contextmenu', function(e) {
42 document.addEventListener('keypress', keyPressHandler);
45 document.addEventListener('DOMContentLoaded', sharedSetup);