From 186c119202540fe85c646509d75ae12b51523537 Mon Sep 17 00:00:00 2001 From: gorhill Date: Mon, 3 Jul 2017 10:54:30 -0400 Subject: [PATCH] fix #2753 --- src/css/logger-ui.css | 2 +- src/js/logger-ui.js | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/css/logger-ui.css b/src/css/logger-ui.css index a1a371b5c..355c2f11e 100644 --- a/src/css/logger-ui.css +++ b/src/css/logger-ui.css @@ -578,12 +578,12 @@ body.colorBlind #netFilteringDialog .dialog > div.containers > div.dynamic tr.e #filterFinderDialog .dialog { padding: 1em; + word-break: break-all; } #filterFinderDialog .dialog code { background: #eee; font-size: 85%; padding: 3px; - word-break: break-all; } #filterFinderDialog .dialog ul { font-size: larger; diff --git a/src/js/logger-ui.js b/src/js/logger-ui.js index b6132781e..c29565061 100644 --- a/src/js/logger-ui.js +++ b/src/js/logger-ui.js @@ -1227,8 +1227,8 @@ var reverseLookupManager = (function() { if ( Array.isArray(lists) === false || lists.length === 0 ) { return null; } - var node; - var p = document.createElement('p'); + var node, + p = document.createElement('p'); reSentence1.lastIndex = 0; var matches = reSentence1.exec(sentence1Template); @@ -1237,7 +1237,10 @@ var reverseLookupManager = (function() { } else { node = uDom.nodeFromSelector('#filterFinderDialogSentence1 > span').cloneNode(true); node.childNodes[0].textContent = sentence1Template.slice(0, matches.index); - node.childNodes[1].textContent = filter; + // https://github.com/gorhill/uBlock/issues/2753 + node.childNodes[1].textContent = filter.length <= 1024 + ? filter + : filter.slice(0, 1023) + '…'; node.childNodes[2].textContent = sentence1Template.slice(reSentence1.lastIndex); } p.appendChild(node); @@ -1273,9 +1276,7 @@ var reverseLookupManager = (function() { for ( var filter in response ) { var p = nodeFromFilter(filter, response[filter]); - if ( p === null ) { - continue; - } + if ( p === null ) { continue; } dialog.appendChild(p); }