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

Unified Diff: chrome/browser/resources/security_warnings/interstitial_v2.js

Issue 584463005: Add debugging information to the SSL blocking page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Brackets for multi-line if Created 6 years, 3 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/security_warnings/interstitial_v2.js
diff --git a/chrome/browser/resources/security_warnings/interstitial_v2.js b/chrome/browser/resources/security_warnings/interstitial_v2.js
index 0da23b75ebbc62df85ffb1c03238e5d2cadaaa67..1905c5835661e7271f77c21cfea98494f4389740 100644
--- a/chrome/browser/resources/security_warnings/interstitial_v2.js
+++ b/chrome/browser/resources/security_warnings/interstitial_v2.js
@@ -8,7 +8,7 @@
var expandedDetails = false;
var keyPressState = 0;
-/*
+/**
* A convenience method for sending commands to the parent page.
* @param {string} cmd The command to send.
*/
@@ -17,7 +17,7 @@ function sendCommand(cmd) {
window.domAutomationController.send(cmd);
}
-/*
+/**
* This allows errors to be skippped by typing "danger" into the page.
* @param {string} e The key that was just pressed.
*/
@@ -34,6 +34,35 @@ function handleKeypress(e) {
}
}
+/**
+ * This appends a piece of debugging information to the end of the warning.
+ * When complete, the caller must also make the debugging div
+ * (error-debugging-info) visible.
+ * @param {string} title The name of this debugging field.
+ * @param {string} value The value of the debugging field.
+ */
+function appendDebuggingField(title, value) {
+ // The values input here are not trusted. Never use innerHTML on these
+ // values!
+ var spanTitle = document.createElement('span');
+ spanTitle.classList.add('debugging-title');
+ spanTitle.innerText = title + ': ';
+
+ var spanValue = document.createElement('span');
+ spanValue.classList.add('debugging-value');
+ spanValue.innerText = value;
+
+ var pElem = document.createElement('p');
+ pElem.classList.add('debugging-content');
+ pElem.appendChild(spanTitle);
+ pElem.appendChild(spanValue);
+ $('error-debugging-info').appendChild(pElem);
+}
+
+function toggleDebuggingInfo() {
+ $('error-debugging-info').classList.toggle('hidden');
+}
+
function setupEvents() {
var overridable = loadTimeData.getBoolean('overridable');
var ssl = loadTimeData.getBoolean('ssl');
@@ -97,6 +126,7 @@ function setupEvents() {
preventDefaultOnPoundLinkClicks();
setupCheckbox();
+ setupSSLDebuggingInfo();
document.addEventListener('keypress', handleKeypress);
}
« no previous file with comments | « chrome/browser/resources/security_warnings/interstitial_v2.html ('k') | chrome/browser/resources/security_warnings/ssl.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698