Add `asap` behavior to `remove-attr` scriptlet

Related issue:
- https://github.com/uBlockOrigin/uAssets/issues/9528
This commit is contained in:
Raymond Hill 2021-07-03 09:19:24 -04:00
parent 5a7600925b
commit 35d7406214
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 4 additions and 5 deletions

View File

@ -731,7 +731,7 @@
}
}
if ( skip ) { return; }
timer = self.requestIdleCallback(rmattr, { timeout: 67 });
timer = self.requestIdleCallback(rmattr, { timeout: 17 });
};
const start = ( ) => {
rmattr();
@ -746,10 +746,10 @@
};
if ( document.readyState !== 'complete' && /\bcomplete\b/.test(behavior) ) {
self.addEventListener('load', start, { once: true });
} else if ( document.readyState === 'loading' ) {
self.addEventListener('DOMContentLoaded', start, { once: true });
} else {
} else if ( document.readyState !== 'loading' || /\basap\b/.test(behavior) ) {
start();
} else {
self.addEventListener('DOMContentLoaded', start, { once: true });
}
})();
@ -1511,7 +1511,6 @@
// These lines below are skipped by the resource parser.
// <<<< end of private namespace
})();