Skip to content

Commit

Permalink
Add asap behavior to remove-attr scriptlet
Browse files Browse the repository at this point in the history
Related issue:
- uBlockOrigin/uAssets#9528
  • Loading branch information
gorhill committed Jul 3, 2021
1 parent 5a76009 commit 35d7406
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions assets/resources/scriptlets.js
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@
}
}
if ( skip ) { return; }
timer = self.requestIdleCallback(rmattr, { timeout: 67 });
timer = self.requestIdleCallback(rmattr, { timeout: 17 });
};
const start = ( ) => {
rmattr();
Expand All @@ -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 });
}
})();

Expand Down Expand Up @@ -1511,7 +1511,6 @@




// These lines below are skipped by the resource parser.
// <<<< end of private namespace
})();

0 comments on commit 35d7406

Please sign in to comment.