Adjust element picker visuals

Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3220
This commit is contained in:
Raymond Hill 2024-04-22 06:08:49 -04:00
parent a60a43103c
commit 4c530b732f
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 3 additions and 16 deletions

View File

@ -73,8 +73,8 @@ html#ublock0-epicker,
#ublock0-epicker section .codeMirrorContainer {
border: none;
box-sizing: border-box;
height: 6em;
max-height: min(6em, 10vh);
height: 10em;
max-height: min(10em, 10vh);
min-height: 1em;
padding: 2px;
width: 100%;
@ -177,7 +177,7 @@ html#ublock0-epicker,
overflow: hidden;
}
#ublock0-epicker #candidateFilters {
max-height: min(12em, 18vh);
max-height: min(18em, 18vh);
overflow-y: auto;
}
#ublock0-epicker .changeFilter > li > span:nth-of-type(1) {

View File

@ -896,19 +896,6 @@ const onOptimizeCandidates = function(details) {
return a.selector.length - b.selector.length;
});
// If two candidates have the same count of matching elements, replace
// the less specific cosmetic filters with the more specific one if the
// less specific one has an id and is simpler
for ( let i = 0, n = results.length-1; i < n; i++ ) {
const a = results[i+0];
const b = results[i+1];
if ( b.count !== a.count ) { continue; }
if ( b.selector.length <= a.selector.length ) { continue; }
if ( a.selector.startsWith('#') === false ) { continue; }
if ( b.selector.length < a.selector.length ) { continue; }
b.selector = a.selector;
}
pickerFramePort.postMessage({
what: 'candidatesOptimized',
candidates: results.map(a => a.selector),