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;
11 var keyPressState = 0;
14 return document.getElementById(o);
17 function sendCommand(cmd) {
18 window.domAutomationController.setAutomationId(1);
19 window.domAutomationController.send(cmd);
22 // This allows errors to be skippped by typing "proceed" into the page.
23 function keyPressHandler(e) {
24 var sequence = 'proceed';
25 if (sequence.charCodeAt(keyPressState) == e.keyCode) {
27 if (keyPressState == sequence.length) {
28 sendCommand(CMD_PROCEED);
36 function sharedSetup() {
37 document.addEventListener('contextmenu', function(e) {
40 document.addEventListener('keypress', keyPressHandler);
43 document.addEventListener('DOMContentLoaded', sharedSetup);