mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-15 15:32:28 +02:00
Also process existing pending callbacks
Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/1629
This commit is contained in:
parent
2693f4e0c2
commit
581e9a1c0c
@ -79,11 +79,17 @@
|
|||||||
dl.hide.end();
|
dl.hide.end();
|
||||||
}
|
}
|
||||||
if ( typeof dl.push === 'function' ) {
|
if ( typeof dl.push === 'function' ) {
|
||||||
dl.push = function(o) {
|
const doCallback = function(item) {
|
||||||
if ( o instanceof Object && typeof o.eventCallback === 'function' ) {
|
if ( item instanceof Object === false ) { return; }
|
||||||
setTimeout(o.eventCallback, 1);
|
if ( typeof item.eventCallback !== 'function' ) { return; }
|
||||||
}
|
setTimeout(item.eventCallback, 1);
|
||||||
};
|
};
|
||||||
|
if ( Array.isArray(dl) ) {
|
||||||
|
for ( const item of dl ) {
|
||||||
|
doCallback(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dl.push = item => doCallback(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// empty ga queue
|
// empty ga queue
|
||||||
|
Loading…
Reference in New Issue
Block a user