1
0
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:
Raymond Hill 2021-06-14 07:36:49 -04:00
parent 2693f4e0c2
commit 581e9a1c0c
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -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