| Index: chrome/browser/resources/ssl/blocking.js
|
| diff --git a/chrome/browser/resources/ssl/blocking.js b/chrome/browser/resources/ssl/blocking.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f2292e12541bcca80365f458c89866f6184b6b41
|
| --- /dev/null
|
| +++ b/chrome/browser/resources/ssl/blocking.js
|
| @@ -0,0 +1,42 @@
|
| +// Copyright 2013 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +function toggleMoreBox() {
|
| + var helpBoxOuter = $('help-box-outer');
|
| + helpBoxOuter.classList.toggle('hidden');
|
| + var moreLessButton = $('more-less-button');
|
| + if (helpBoxOuter.classList.contains('hidden')) {
|
| + moreLessButton.innerText = templateData.more;
|
| + } else {
|
| + moreLessButton.innerText = templateData.less;
|
| + }
|
| +}
|
| +
|
| +// This allows errors to be skippped by typing "proceed" into the page.
|
| +var keyPressState = 0;
|
| +function keyPressHandler(e) {
|
| + var sequence = 'proceed';
|
| + if (sequence.charCodeAt(keyPressState) == e.keyCode) {
|
| + keyPressState++;
|
| + if (keyPressState == sequence.length) {
|
| + window.domAutomationController.send(1); // Proceed.
|
| + keyPressState = 0;
|
| + }
|
| + } else {
|
| + keyPressState = 0;
|
| + }
|
| +}
|
| +
|
| +function reloadPage() {
|
| + window.domAutomationController.send(4);
|
| +}
|
| +
|
| +function setupEvents() {
|
| + window.domAutomationController.setAutomationId(1);
|
| + $('reload-button').addEventListener('click', reloadPage);
|
| + $('more-less-button').addEventListener('click', toggleMoreBox);
|
| + document.addEventListener('keypress', keyPressHandler);
|
| +}
|
| +
|
| +document.addEventListener('DOMContentLoaded', setupEvents);
|
|
|