mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-20 13:03:56 +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
1 changed files with 10 additions and 4 deletions
|
@ -79,11 +79,17 @@
|
|||
dl.hide.end();
|
||||
}
|
||||
if ( typeof dl.push === 'function' ) {
|
||||
dl.push = function(o) {
|
||||
if ( o instanceof Object && typeof o.eventCallback === 'function' ) {
|
||||
setTimeout(o.eventCallback, 1);
|
||||
}
|
||||
const doCallback = function(item) {
|
||||
if ( item instanceof Object === false ) { return; }
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue