Browse Source

Do sticky killing in an idle callback

master
saturn 6 years ago
parent
commit
0bd6797358
1 changed files with 9 additions and 5 deletions
  1. 9
    5
      src/contentScript.js

+ 9
- 5
src/contentScript.js View File

@@ -99,9 +99,11 @@ function restoreScrollability() {
*/
function startConstantVigilance() {
var observer = new MutationObserver((mutationsList, observer) => {
for (var mutation of mutationsList) {
killSticky(mutation.target);
}
window.requestIdleCallback(() => {
for (var mutation of mutationsList) {
killSticky(mutation.target);
}
});
});

console.log("Commencing vigilance for stickies!");
@@ -118,8 +120,10 @@ function startConstantVigilance() {
function beginKillingStickies() {
if (!window.AKS) window.AKS = { stickiesKilled: 0 };

killSticky();
startConstantVigilance();
window.requestIdleCallback(() => {
killSticky();
startConstantVigilance();
});
}

/******************/

Loading…
Cancel
Save