summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/browser/resources/conflicts/about_conflicts.js
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/chrome/browser/resources/conflicts/about_conflicts.js')
-rw-r--r--chromium/chrome/browser/resources/conflicts/about_conflicts.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/chromium/chrome/browser/resources/conflicts/about_conflicts.js b/chromium/chrome/browser/resources/conflicts/about_conflicts.js
index eb750549ea5..f44af07a016 100644
--- a/chromium/chrome/browser/resources/conflicts/about_conflicts.js
+++ b/chromium/chrome/browser/resources/conflicts/about_conflicts.js
@@ -43,15 +43,35 @@ function requestModuleListData() {
}
/**
+ * Filters list of displayed modules to those listed in the process types
+ * specified in the url fragment. For instance, chrome://conflicts/#r will show
+ * only those modules that have loaded into a renderer.
+ */
+function filterModuleListData() {
+ const filter = window.location.hash.substr(1).toLowerCase();
+ const modules = document.getElementsByClassName('module');
+
+ // Loop through all modules, and hide all that don't match the filter.
+ for (i = 0; i < modules.length; ++i) {
+ modules[i].style.display =
+ modules[i].dataset.process.includes(filter) ? '' : 'none';
+ }
+}
+
+/**
* Called by the WebUI to re-populate the page with data representing the
* current state of installed modules.
* @param {Object} moduleListData Information about available modules.
*/
function returnModuleList(moduleListData) {
renderTemplate(moduleListData);
+ if (window.location.hash.length > 1) {
+ filterModuleListData();
+ }
$('loading-message').style.visibility = 'hidden';
$('body-container').style.visibility = 'visible';
}
// Get data and have it displayed upon loading.
document.addEventListener('DOMContentLoaded', requestModuleListData);
+window.addEventListener('hashchange', filterModuleListData, false);