Do sticky killing in an idle callback
This commit is contained in:
parent
6711ae5729
commit
0bd6797358
@ -99,9 +99,11 @@ function restoreScrollability() {
|
|||||||
*/
|
*/
|
||||||
function startConstantVigilance() {
|
function startConstantVigilance() {
|
||||||
var observer = new MutationObserver((mutationsList, observer) => {
|
var observer = new MutationObserver((mutationsList, observer) => {
|
||||||
for (var mutation of mutationsList) {
|
window.requestIdleCallback(() => {
|
||||||
killSticky(mutation.target);
|
for (var mutation of mutationsList) {
|
||||||
}
|
killSticky(mutation.target);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("Commencing vigilance for stickies!");
|
console.log("Commencing vigilance for stickies!");
|
||||||
@ -118,8 +120,10 @@ function startConstantVigilance() {
|
|||||||
function beginKillingStickies() {
|
function beginKillingStickies() {
|
||||||
if (!window.AKS) window.AKS = { stickiesKilled: 0 };
|
if (!window.AKS) window.AKS = { stickiesKilled: 0 };
|
||||||
|
|
||||||
killSticky();
|
window.requestIdleCallback(() => {
|
||||||
startConstantVigilance();
|
killSticky();
|
||||||
|
startConstantVigilance();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************/
|
/******************/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user