mirror of https://github.com/gorhill/uBlock.git
Adjust element picker visuals
Related issue: https://github.com/uBlockOrigin/uBlock-issues/issues/3220
This commit is contained in:
parent
a60a43103c
commit
4c530b732f
|
@ -73,8 +73,8 @@ html#ublock0-epicker,
|
||||||
#ublock0-epicker section .codeMirrorContainer {
|
#ublock0-epicker section .codeMirrorContainer {
|
||||||
border: none;
|
border: none;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
height: 6em;
|
height: 10em;
|
||||||
max-height: min(6em, 10vh);
|
max-height: min(10em, 10vh);
|
||||||
min-height: 1em;
|
min-height: 1em;
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -177,7 +177,7 @@ html#ublock0-epicker,
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
#ublock0-epicker #candidateFilters {
|
#ublock0-epicker #candidateFilters {
|
||||||
max-height: min(12em, 18vh);
|
max-height: min(18em, 18vh);
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
#ublock0-epicker .changeFilter > li > span:nth-of-type(1) {
|
#ublock0-epicker .changeFilter > li > span:nth-of-type(1) {
|
||||||
|
|
|
@ -896,19 +896,6 @@ const onOptimizeCandidates = function(details) {
|
||||||
return a.selector.length - b.selector.length;
|
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({
|
pickerFramePort.postMessage({
|
||||||
what: 'candidatesOptimized',
|
what: 'candidatesOptimized',
|
||||||
candidates: results.map(a => a.selector),
|
candidates: results.map(a => a.selector),
|
||||||
|
|
Loading…
Reference in New Issue