mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
Revert "Render List stats below on mobile"
This reverts commit 9ea39886b6
.
This commit is contained in:
parent
b0219570b6
commit
df5437a54f
@ -130,18 +130,13 @@ builtinScriptlets.push({
|
|||||||
});
|
});
|
||||||
function runAt(fn, when) {
|
function runAt(fn, when) {
|
||||||
const intFromReadyState = state => {
|
const intFromReadyState = state => {
|
||||||
const targets = {
|
return ({
|
||||||
'loading': 1,
|
loading: 1,
|
||||||
'interactive': 2, 'end': 2, '2': 2,
|
interactive: 2,
|
||||||
'complete': 3, 'idle': 3, '3': 3,
|
end: 2,
|
||||||
};
|
complete: 3,
|
||||||
const tokens = Array.isArray(state) ? state : [ state ];
|
idle: 3,
|
||||||
for ( const token of tokens ) {
|
})[`${state}`] || 0;
|
||||||
const prop = `${token}`;
|
|
||||||
if ( targets.hasOwnProperty(prop) === false ) { continue; }
|
|
||||||
return targets[prop];
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
};
|
};
|
||||||
const runAt = intFromReadyState(when);
|
const runAt = intFromReadyState(when);
|
||||||
if ( intFromReadyState(document.readyState) >= runAt ) {
|
if ( intFromReadyState(document.readyState) >= runAt ) {
|
||||||
@ -1035,22 +1030,14 @@ builtinScriptlets.push({
|
|||||||
function setConstant(
|
function setConstant(
|
||||||
arg1 = '',
|
arg1 = '',
|
||||||
arg2 = '',
|
arg2 = '',
|
||||||
arg3 = ''
|
arg3 = 0
|
||||||
) {
|
) {
|
||||||
const details = typeof arg1 !== 'object'
|
const details = typeof arg1 !== 'object'
|
||||||
? { prop: arg1, value: arg2 }
|
? { prop: arg1, value: arg2, runAt: parseInt(arg3, 10) || 0 }
|
||||||
: arg1;
|
: arg1;
|
||||||
if ( arg3 !== '' ) {
|
|
||||||
if ( /^\d$/.test(arg3) ) {
|
|
||||||
details.options = [ arg3 ];
|
|
||||||
} else {
|
|
||||||
details.options = Array.from(arguments).slice(2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const { prop: chain = '', value: cValue = '' } = details;
|
const { prop: chain = '', value: cValue = '' } = details;
|
||||||
if ( typeof chain !== 'string' ) { return; }
|
if ( typeof chain !== 'string' ) { return; }
|
||||||
if ( chain === '' ) { return; }
|
if ( chain === '' ) { return; }
|
||||||
const options = details.options || [];
|
|
||||||
function setConstant(chain, cValue) {
|
function setConstant(chain, cValue) {
|
||||||
const trappedProp = (( ) => {
|
const trappedProp = (( ) => {
|
||||||
const pos = chain.lastIndexOf('.');
|
const pos = chain.lastIndexOf('.');
|
||||||
@ -1106,20 +1093,13 @@ function setConstant(
|
|||||||
cValue = cloakFunc(function(){ return true; });
|
cValue = cloakFunc(function(){ return true; });
|
||||||
} else if ( cValue === 'falseFunc' ) {
|
} else if ( cValue === 'falseFunc' ) {
|
||||||
cValue = cloakFunc(function(){ return false; });
|
cValue = cloakFunc(function(){ return false; });
|
||||||
} else if ( /^-?\d+$/.test(cValue) ) {
|
} else if ( /^\d+$/.test(cValue) ) {
|
||||||
cValue = parseInt(cValue);
|
cValue = parseFloat(cValue);
|
||||||
if ( isNaN(cValue) ) { return; }
|
if ( isNaN(cValue) ) { return; }
|
||||||
if ( Math.abs(cValue) > 0x7FFF ) { return; }
|
if ( Math.abs(cValue) > 0x7FFF ) { return; }
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( options.includes('asCallback') ) {
|
|
||||||
cValue = ( ) => cValue;
|
|
||||||
} else if ( options.includes('asResolve') ) {
|
|
||||||
cValue = Promise.resolve(cValue);
|
|
||||||
} else if ( options.includes('asReject') ) {
|
|
||||||
cValue = Promise.reject(cValue);
|
|
||||||
}
|
|
||||||
let aborted = false;
|
let aborted = false;
|
||||||
const mustAbort = function(v) {
|
const mustAbort = function(v) {
|
||||||
if ( aborted ) { return true; }
|
if ( aborted ) { return true; }
|
||||||
@ -1213,7 +1193,7 @@ function setConstant(
|
|||||||
}
|
}
|
||||||
runAt(( ) => {
|
runAt(( ) => {
|
||||||
setConstant(chain, cValue);
|
setConstant(chain, cValue);
|
||||||
}, options);
|
}, details.runAt);
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
@ -182,12 +182,6 @@ const renderFilterLists = ( ) => {
|
|||||||
}
|
}
|
||||||
for ( const [ listkey, listDetails ] of treeEntries ) {
|
for ( const [ listkey, listDetails ] of treeEntries ) {
|
||||||
const listEntry = createListEntry(listDetails, depth);
|
const listEntry = createListEntry(listDetails, depth);
|
||||||
if ( dom.cl.has(dom.root, 'mobile') ) {
|
|
||||||
const leafStats = qs$(listEntry, '.leafstats');
|
|
||||||
if ( leafStats ) {
|
|
||||||
listEntry.append(leafStats);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
listEntry.dataset.key = listkey;
|
listEntry.dataset.key = listkey;
|
||||||
listEntry.dataset.parent = parentkey;
|
listEntry.dataset.parent = parentkey;
|
||||||
dom.text(qs$(listEntry, '.listname'), listDetails.title);
|
dom.text(qs$(listEntry, '.listname'), listDetails.title);
|
||||||
|
Loading…
Reference in New Issue
Block a user