summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/resources/net_internals
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/chrome/browser/resources/net_internals')
-rw-r--r--chromium/chrome/browser/resources/net_internals/browser_bridge.js63
-rw-r--r--chromium/chrome/browser/resources/net_internals/chromeos_view.html83
-rw-r--r--chromium/chrome/browser/resources/net_internals/chromeos_view.js250
-rw-r--r--chromium/chrome/browser/resources/net_internals/domain_security_policy_view.html7
-rw-r--r--chromium/chrome/browser/resources/net_internals/domain_security_policy_view.js28
-rw-r--r--chromium/chrome/browser/resources/net_internals/events_view.html2
-rw-r--r--chromium/chrome/browser/resources/net_internals/index.html1
-rw-r--r--chromium/chrome/browser/resources/net_internals/net_internals_resources.grd4
8 files changed, 43 insertions, 395 deletions
diff --git a/chromium/chrome/browser/resources/net_internals/browser_bridge.js b/chromium/chrome/browser/resources/net_internals/browser_bridge.js
index fac5fb1d4d1..5c26ac203d6 100644
--- a/chromium/chrome/browser/resources/net_internals/browser_bridge.js
+++ b/chromium/chrome/browser/resources/net_internals/browser_bridge.js
@@ -18,8 +18,6 @@ const BrowserBridge = (function() {
// List of observers for various bits of browser state.
this.hstsObservers_ = [];
this.expectCTObservers_ = [];
- this.crosONCFileParseObservers_ = [];
- this.storeDebugLogsObservers_ = [];
this.setNetworkDebugModeObservers_ = [];
}
@@ -89,22 +87,6 @@ const BrowserBridge = (function() {
this.send('flushSocketPools');
},
- importONCFile(fileContent, passcode) {
- this.send('importONCFile', [fileContent, passcode]);
- },
-
- storeDebugLogs() {
- this.send('storeDebugLogs');
- },
-
- storeCombinedDebugLogs() {
- this.send('storeCombinedDebugLogs');
- },
-
- storeFeedbackSystemLogs() {
- this.send('storeFeedbackSystemLogs');
- },
-
setNetworkDebugMode(subsystem) {
this.send('setNetworkDebugMode', [subsystem]);
},
@@ -135,30 +117,6 @@ const BrowserBridge = (function() {
}
},
- receivedONCFileParse(error) {
- for (let i = 0; i < this.crosONCFileParseObservers_.length; i++) {
- this.crosONCFileParseObservers_[i].onONCFileParse(error);
- }
- },
-
- receivedStoreDebugLogs(status) {
- for (let i = 0; i < this.storeDebugLogsObservers_.length; i++) {
- this.storeDebugLogsObservers_[i].onStoreDebugLogs(status);
- }
- },
-
- receivedStoreCombinedDebugLogs(status) {
- for (let i = 0; i < this.storeDebugLogsObservers_.length; i++) {
- this.storeDebugLogsObservers_[i].onStoreCombinedDebugLogs(status);
- }
- },
-
- receivedStoreFeedbackSystemLogs(status) {
- for (let i = 0; i < this.storeDebugLogsObservers_.length; i++) {
- this.storeDebugLogsObservers_[i].onStoreFeedbackSystemLogs(status);
- }
- },
-
receivedSetNetworkDebugMode(status) {
for (let i = 0; i < this.setNetworkDebugModeObservers_.length; i++) {
this.setNetworkDebugModeObservers_[i].onSetNetworkDebugMode(status);
@@ -188,27 +146,6 @@ const BrowserBridge = (function() {
},
/**
- * Adds a listener for ONC file parse status. The observer will be called
- * back with:
- *
- * observer.onONCFileParse(error);
- */
- addCrosONCFileParseObserver(observer) {
- this.crosONCFileParseObservers_.push(observer);
- },
-
- /**
- * Adds a listener for storing log file status. The observer will be called
- * back with:
- *
- * observer.onStoreDebugLogs(status);
- * observer.onStoreCombinedDebugLogs(status);
- */
- addStoreDebugLogsObserver(observer) {
- this.storeDebugLogsObservers_.push(observer);
- },
-
- /**
* Adds a listener for network debugging mode status. The observer
* will be called back with:
*
diff --git a/chromium/chrome/browser/resources/net_internals/chromeos_view.html b/chromium/chrome/browser/resources/net_internals/chromeos_view.html
index ac4ae56ec08..71c81564e28 100644
--- a/chromium/chrome/browser/resources/net_internals/chromeos_view.html
+++ b/chromium/chrome/browser/resources/net_internals/chromeos_view.html
@@ -1,76 +1,19 @@
<div id="chromeos-view-tab-content" class=content-box>
<h4 style='margin-top:0'>Import ONC file</h4>
- <div id="chromeos-view-import-div">
- <label>Import ONC File
- <input type="file" id="chromeos-view-import-onc">
- </label>
+ <div>
+ Import ONC File has moved to
+ <a href="chrome://network#general">chrome://network#general</a>.
</div>
- <div id="chromeos-view-password-div" hidden>
- This onc file appears to be encrypted. Please provide the decryption key:
- <div>
- <input type="password" id="chromeos-view-onc-password">
- </div>
+
+ <h4>Store system logs</h4>
+ <div>
+ Store system logs has moved to
+ <a href="chrome://network#logs">chrome://network#logs</a>.
</div>
- <div id="chromeos-view-parse-status" hidden>
- </div>
- <div id="chromeos-view-store-debug-logs-div">
- <h4>Store system logs</h4>
- <div>
- <p>This stores system_logs_{date}-{time}.txt.zip to the Downloads
- directory. The archive contains a single file identical to the
- system_logs file attached to Feedback reports.</p>
- <p>Also writes a policies_{date}-{time}.json file for providing policy
- configurations when that might be a factor.</p>
- <p>Prefer this when uploading logs to issues or sending logs to developers
- (unless otherwise requested).</p>
- <input type="button"
- id="chromeos-view-store-feedback-system-logs"
- value="Store Feedback Report System Logs">
- <label id="chromeos-view-store-feedback-system-logs-status"></label>
- </div>
- <h4>Store debugd system logs</h4>
- <div>
- <p>This stores the logs collected by debugd as individual files in a
- single archive file in the Downloads directory:
- debug-logs_{date}-{time}.tgz.
- </p>
- <p>Also writes a policies_{date}-{time}.json file for providing policy
- configurations when that might be a factor.</p>
- <input type="button"
- id="chromeos-view-store-debug-logs"
- value="Store System Logs">
- <label id="chromeos-view-store-debug-logs-status"></label>
- </div>
- <div>
- <p>Identical to the above, but also incldes the Chrome user logs.
- The output file is named combined-logs_{date}-{time}.tgz.</p>
- <input type="button"
- id="chromeos-view-store-combined-debug-logs"
- value="Store System and User Logs">
- <label id="chromeos-view-store-combined-debug-logs-status"></label>
- </div>
- </div>
- <div id="chromeos-view-network-debugging-div">
- <h4>Network Debugging</h4>
- <dl>
- <dt>Select interface for debugging</dt>
- <dd>
- <input type="button"
- value="Wi-Fi"
- id="chromeos-view-network-debugging-wifi">
- <input type="button"
- value="Ethernet"
- id="chromeos-view-network-debugging-ethernet">
- <input type="button"
- value="Cellular"
- id="chromeos-view-network-debugging-cellular">
- <input type="button"
- name="subsystem"
- value="None"
- id="chromeos-view-network-debugging-none">
- </dd>
- </dl>
- <label id="chromeos-view-network-debugging-status">
- </label>
+
+ <h4>Network Debugging</h4>
+ <div>
+ Network Debugging has moved to
+ <a href="chrome://network#logs">chrome://network#logs</a>.
</div>
</div>
diff --git a/chromium/chrome/browser/resources/net_internals/chromeos_view.js b/chromium/chrome/browser/resources/net_internals/chromeos_view.js
index 07022b53664..253465ccd60 100644
--- a/chromium/chrome/browser/resources/net_internals/chromeos_view.js
+++ b/chromium/chrome/browser/resources/net_internals/chromeos_view.js
@@ -8,225 +8,6 @@
const CrosView = (function() {
'use strict';
- let fileContent;
- let passcode = '';
-
- /**
- * Clear file input div
- *
- * @private
- */
- function clearFileInput_() {
- $(CrosView.IMPORT_DIV_ID).innerHTML = $(CrosView.IMPORT_DIV_ID).innerHTML;
- $(CrosView.IMPORT_ONC_ID)
- .addEventListener('change', handleFileChangeEvent_, false);
- }
-
- /**
- * Send file contents and passcode to C++ cros network library.
- *
- * @private
- */
- function importONCFile_() {
- clearParseStatus_();
- if (fileContent) {
- g_browser.importONCFile(fileContent, passcode);
- } else {
- setParseStatus_('ONC file parse failed: cannot read file');
- }
- clearFileInput_();
- }
-
- /**
- * Set the passcode var, and trigger onc import.
- *
- * @param {string} value The passcode value.
- * @private
- */
- function setPasscode_(value) {
- passcode = value;
- if (passcode) {
- importONCFile_();
- }
- }
-
- /**
- * Unhide the passcode prompt input field and give it focus.
- *
- * @private
- */
- function promptForPasscode_() {
- $(CrosView.PASSCODE_ID).hidden = false;
- $(CrosView.PASSCODE_INPUT_ID).focus();
- $(CrosView.PASSCODE_INPUT_ID).select();
- }
-
- /**
- * Set the fileContent var, and trigger onc import if the file appears to
- * not be encrypted, or prompt for passcode if the file is encrypted.
- *
- * @private
- * @param {string} text contents of selected file.
- */
- function setFileContent_(result) {
- fileContent = result;
- // Parse the JSON to get at the top level "Type" property.
- let jsonObject;
- // Ignore any parse errors: they'll get handled in the C++ import code.
- try {
- jsonObject = JSON.parse(fileContent);
- } catch (error) {
- }
- // Check if file is encrypted.
- if (jsonObject && jsonObject.hasOwnProperty('Type') &&
- jsonObject.Type == 'EncryptedConfiguration') {
- promptForPasscode_();
- } else {
- importONCFile_();
- }
- }
-
- /**
- * Clear ONC file parse status. Clears and hides the parse status div.
- *
- * @private
- */
- function clearParseStatus_(error) {
- const parseStatus = $(CrosView.PARSE_STATUS_ID);
- parseStatus.hidden = true;
- parseStatus.textContent = '';
- }
-
- /**
- * Set ONC file parse status.
- *
- * @private
- */
- function setParseStatus_(error) {
- const parseStatus = $(CrosView.PARSE_STATUS_ID);
- parseStatus.hidden = false;
- parseStatus.textContent = error ? 'ONC file parse failed: ' + error :
- 'ONC file successfully parsed';
- reset_();
- }
-
- /**
- * Set storing debug logs status.
- *
- * @private
- */
- function setStoreDebugLogsStatus_(status) {
- $(CrosView.STORE_DEBUG_LOGS_STATUS_ID).innerText = status;
- }
-
-
- /**
- * Set storing combined debug logs status.
- *
- * @private
- */
- function setStoreCombinedDebugLogsStatus_(status) {
- $(CrosView.STORE_COMBINED_DEBUG_LOGS_STATUS_ID).innerText = status;
- }
-
- /**
- * Set storing combined debug logs status.
- *
- * @private
- */
- function setStoreFeedbackSystemLogsStatus_(status) {
- $(CrosView.STORE_FEEDBACK_SYSTEM_LOGS_STATUS_ID).innerText = status;
- }
-
- /**
- * Set status for current debug mode.
- *
- * @private
- */
- function setNetworkDebugModeStatus_(status) {
- $(CrosView.DEBUG_STATUS_ID).innerText = status;
- }
-
- /**
- * An event listener for the file selection field.
- *
- * @private
- */
- function handleFileChangeEvent_(event) {
- clearParseStatus_();
- const file = event.target.files[0];
- const reader = new FileReader();
- reader.onloadend = function(e) {
- setFileContent_(reader.result);
- };
- reader.readAsText(file);
- }
-
- /**
- * Add event listeners for the file selection, passcode input
- * fields, for the button for debug logs storing and for buttons
- * for debug mode selection.
- *
- * @private
- */
- function addEventListeners_() {
- $(CrosView.IMPORT_ONC_ID)
- .addEventListener('change', handleFileChangeEvent_, false);
-
- $(CrosView.PASSCODE_INPUT_ID).addEventListener('change', function(event) {
- setPasscode_(this.value);
- }, false);
-
- $(CrosView.STORE_DEBUG_LOGS_ID).addEventListener('click', function(event) {
- $(CrosView.STORE_DEBUG_LOGS_STATUS_ID).innerText = '';
- g_browser.storeDebugLogs();
- }, false);
- $(CrosView.STORE_COMBINED_DEBUG_LOGS_ID)
- .addEventListener('click', function(event) {
- $(CrosView.STORE_COMBINED_DEBUG_LOGS_STATUS_ID).innerText = '';
- g_browser.storeCombinedDebugLogs();
- }, false);
- $(CrosView.STORE_FEEDBACK_SYSTEM_LOGS_ID)
- .addEventListener('click', function(event) {
- $(CrosView.STORE_FEEDBACK_SYSTEM_LOGS_STATUS_ID).innerText = '';
- g_browser.storeFeedbackSystemLogs();
- }, false);
-
- $(CrosView.DEBUG_WIFI_ID).addEventListener('click', function(event) {
- setNetworkDebugMode_('wifi');
- }, false);
- $(CrosView.DEBUG_ETHERNET_ID).addEventListener('click', function(event) {
- setNetworkDebugMode_('ethernet');
- }, false);
- $(CrosView.DEBUG_CELLULAR_ID).addEventListener('click', function(event) {
- setNetworkDebugMode_('cellular');
- }, false);
- $(CrosView.DEBUG_NONE_ID).addEventListener('click', function(event) {
- setNetworkDebugMode_('none');
- }, false);
- }
-
- /**
- * Reset fileContent and passcode vars.
- *
- * @private
- */
- function reset_() {
- fileContent = undefined;
- passcode = '';
- $(CrosView.PASSCODE_ID).hidden = true;
- }
-
- /**
- * Enables or disables debug mode for a specified subsystem.
- *
- * @private
- */
- function setNetworkDebugMode_(subsystem) {
- $(CrosView.DEBUG_STATUS_ID).innerText = '';
- g_browser.setNetworkDebugMode(subsystem);
- }
-
/**
* @constructor
* @extends {DivView}
@@ -236,11 +17,6 @@ const CrosView = (function() {
// Call superclass's constructor.
DivView.call(this, CrosView.MAIN_BOX_ID);
-
- g_browser.addCrosONCFileParseObserver(this);
- g_browser.addStoreDebugLogsObserver(this);
- g_browser.addSetNetworkDebugModeObserver(this);
- addEventListeners_();
}
CrosView.TAB_ID = 'tab-handle-chromeos';
@@ -248,38 +24,12 @@ const CrosView = (function() {
CrosView.TAB_HASH = '#chromeos';
CrosView.MAIN_BOX_ID = 'chromeos-view-tab-content';
- CrosView.IMPORT_DIV_ID = 'chromeos-view-import-div';
- CrosView.IMPORT_ONC_ID = 'chromeos-view-import-onc';
- CrosView.PASSCODE_ID = 'chromeos-view-password-div';
- CrosView.PASSCODE_INPUT_ID = 'chromeos-view-onc-password';
- CrosView.PARSE_STATUS_ID = 'chromeos-view-parse-status';
- CrosView.STORE_DEBUG_LOGS_ID = 'chromeos-view-store-debug-logs';
- CrosView.STORE_DEBUG_LOGS_STATUS_ID = 'chromeos-view-store-debug-logs-status';
- CrosView.STORE_COMBINED_DEBUG_LOGS_ID =
- 'chromeos-view-store-combined-debug-logs';
- CrosView.STORE_COMBINED_DEBUG_LOGS_STATUS_ID =
- 'chromeos-view-store-combined-debug-logs-status';
- CrosView.STORE_FEEDBACK_SYSTEM_LOGS_ID =
- 'chromeos-view-store-feedback-system-logs';
- CrosView.STORE_FEEDBACK_SYSTEM_LOGS_STATUS_ID =
- 'chromeos-view-store-feedback-system-logs-status';
- CrosView.DEBUG_WIFI_ID = 'chromeos-view-network-debugging-wifi';
- CrosView.DEBUG_ETHERNET_ID = 'chromeos-view-network-debugging-ethernet';
- CrosView.DEBUG_CELLULAR_ID = 'chromeos-view-network-debugging-cellular';
- CrosView.DEBUG_NONE_ID = 'chromeos-view-network-debugging-none';
- CrosView.DEBUG_STATUS_ID = 'chromeos-view-network-debugging-status';
cr.addSingletonGetter(CrosView);
CrosView.prototype = {
// Inherit from DivView.
__proto__: DivView.prototype,
-
- onONCFileParse: setParseStatus_,
- onStoreDebugLogs: setStoreDebugLogsStatus_,
- onStoreCombinedDebugLogs: setStoreCombinedDebugLogsStatus_,
- onStoreFeedbackSystemLogs: setStoreFeedbackSystemLogsStatus_,
- onSetNetworkDebugMode: setNetworkDebugModeStatus_,
};
return CrosView;
diff --git a/chromium/chrome/browser/resources/net_internals/domain_security_policy_view.html b/chromium/chrome/browser/resources/net_internals/domain_security_policy_view.html
index aaac84b199c..746c4c63572 100644
--- a/chromium/chrome/browser/resources/net_internals/domain_security_policy_view.html
+++ b/chromium/chrome/browser/resources/net_internals/domain_security_policy_view.html
@@ -45,6 +45,13 @@
Transparency information. See
<a href="https://tools.ietf.org/html/draft-ietf-httpbis-expect-ct" target=_blank>https://tools.ietf.org/html/draft-ietf-httpbis-expect-ct</a>.</div>
+ <p>To protect against cross-site tracking, Expect-CT data will soon be keyed
+ on the site of the main frame and innermost frame when an Expect-CT
+ header is encountered. When that behavior is enabled, both adding and
+ querying an Expect-CT domain use the eTLD+1 of the provided domain as
+ the site for both frames. Deleting policies affects information stored
+ for that domain in the context of all sites, however.</p>
+
<h4>Add Expect-CT domain</h4>
<p>Input a domain name to add it to the Expect-CT set. Leave Enforce unchecked
diff --git a/chromium/chrome/browser/resources/net_internals/domain_security_policy_view.js b/chromium/chrome/browser/resources/net_internals/domain_security_policy_view.js
index 5e5bcd4ad09..67126e523a3 100644
--- a/chromium/chrome/browser/resources/net_internals/domain_security_policy_view.js
+++ b/chromium/chrome/browser/resources/net_internals/domain_security_policy_view.js
@@ -152,7 +152,7 @@ const DomainSecurityPolicyView = (function() {
onHSTSQueryResult(result) {
if (result.error != undefined) {
- this.queryStsOutputDiv_.innerHTML = '';
+ this.queryStsOutputDiv_.innerHTML = trustedTypes.emptyHTML;
const s = addNode(this.queryStsOutputDiv_, 'span');
s.textContent = result.error;
s.style.color = '#e00';
@@ -161,15 +161,21 @@ const DomainSecurityPolicyView = (function() {
}
if (result.result == false) {
- this.queryStsOutputDiv_.innerHTML = '<b>Not found</b>';
+ this.queryStsOutputDiv_.innerHTML = trustedTypes.emptyHTML;
+ const notFound = document.createElement('b');
+ notFound.textContent = 'Not found';
+ this.queryStsOutputDiv_.appendChild(notFound);
yellowFade(this.queryStsOutputDiv_);
return;
}
- this.queryStsOutputDiv_.innerHTML = '';
+ this.queryStsOutputDiv_.innerHTML = trustedTypes.emptyHTML;
const s = addNode(this.queryStsOutputDiv_, 'span');
- s.innerHTML = '<b>Found:</b><br/>';
+ const found = document.createElement('b');
+ found.textContent = 'Found:';
+ s.appendChild(found);
+ s.appendChild(document.createElement('br'));
const keys = [
'static_sts_domain',
@@ -244,7 +250,7 @@ const DomainSecurityPolicyView = (function() {
onExpectCTQueryResult(result) {
if (result.error != undefined) {
- this.queryExpectCTOutputDiv_.innerHTML = '';
+ this.queryExpectCTOutputDiv_.innerHTML = trustedTypes.emptyHTML;
const s = addNode(this.queryExpectCTOutputDiv_, 'span');
s.textContent = result.error;
s.style.color = '#e00';
@@ -253,15 +259,21 @@ const DomainSecurityPolicyView = (function() {
}
if (result.result == false) {
- this.queryExpectCTOutputDiv_.innerHTML = '<b>Not found</b>';
+ this.queryExpectCTOutputDiv_.innerHTML = trustedTypes.emptyHTML;
+ const notFound = document.createElement('b');
+ notFound.textContent = 'Not found';
+ this.queryExpectCTOutputDiv_.appendChild(notFound);
yellowFade(this.queryExpectCTOutputDiv_);
return;
}
- this.queryExpectCTOutputDiv_.innerHTML = '';
+ this.queryExpectCTOutputDiv_.innerHTML = trustedTypes.emptyHTML;
const s = addNode(this.queryExpectCTOutputDiv_, 'span');
- s.innerHTML = '<b>Found:</b><br/>';
+ const found = document.createElement('b');
+ found.textContent = 'Found:';
+ s.appendChild(found);
+ s.appendChild(document.createElement('br'));
const keys = [
'dynamic_expect_ct_domain',
diff --git a/chromium/chrome/browser/resources/net_internals/events_view.html b/chromium/chrome/browser/resources/net_internals/events_view.html
index 2b00d73bfa2..950e3ca8236 100644
--- a/chromium/chrome/browser/resources/net_internals/events_view.html
+++ b/chromium/chrome/browser/resources/net_internals/events_view.html
@@ -1,6 +1,6 @@
<!-- ================= Events view =================== -->
<div id=events-view-tab-content class=content-box>
The net-internals events viewer and related functionality has been removed.
- Please use <a href="chrome://net-export">chrome://net-export</a> to save netlogs and the external <a href="https://chromium.googlesource.com/catapult/+/master/netlog_viewer/">catapult netlog_viewer</a> to view them.
+ Please use <a href="chrome://net-export">chrome://net-export</a> to save netlogs and the external <a href="https://netlog-viewer.appspot.com/">netlog_viewer</a> to view them.
</div>
diff --git a/chromium/chrome/browser/resources/net_internals/index.html b/chromium/chrome/browser/resources/net_internals/index.html
index 56f50557873..cf44da3960d 100644
--- a/chromium/chrome/browser/resources/net_internals/index.html
+++ b/chromium/chrome/browser/resources/net_internals/index.html
@@ -30,6 +30,5 @@ found in the LICENSE file.
<include src="chromeos_view.html">
</div>
- <script src="chrome://resources/js/jstemplate_compiled.js"></script>
</body>
</html>
diff --git a/chromium/chrome/browser/resources/net_internals/net_internals_resources.grd b/chromium/chrome/browser/resources/net_internals/net_internals_resources.grd
index dddecdbee29..5dc7b0e4a8f 100644
--- a/chromium/chrome/browser/resources/net_internals/net_internals_resources.grd
+++ b/chromium/chrome/browser/resources/net_internals/net_internals_resources.grd
@@ -10,8 +10,8 @@
</outputs>
<release seq="1">
<includes>
- <include name="IDR_NET_INTERNALS_INDEX_HTML" file="index.html" flattenhtml="true" allowexternalscript="true" compress="gzip" type="BINDATA" />
- <include name="IDR_NET_INTERNALS_INDEX_JS" file="index.js" flattenhtml="true" compress="gzip" type="BINDATA" />
+ <include name="IDR_NET_INTERNALS_INDEX_HTML" file="index.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
+ <include name="IDR_NET_INTERNALS_INDEX_JS" file="index.js" flattenhtml="true" type="BINDATA" />
</includes>
</release>
</grit>