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

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: 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..37f13bc27ce218227a53bc196096178abd10901b 100644
--- a/chrome/browser/resources/security_warnings/interstitial_v2.js
+++ b/chrome/browser/resources/security_warnings/interstitial_v2.js
@@ -34,6 +34,35 @@ function handleKeypress(e) {
}
}
+/*
Bernhard Bauer 2014/09/19 08:40:35 One more asterisk here to make this a JSDoc commen
felt 2014/09/20 15:47:02 Done.
+ * 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-par');
+ 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);
}

Powered by Google App Engine
This is Rietveld 408576698