Explorar el Código

Do sticky killing in an idle callback

master
saturn hace 6 años
padre
commit
0bd6797358
Se han modificado 1 ficheros con 9 adiciones y 5 borrados
  1. 9
    5
      src/contentScript.js

+ 9
- 5
src/contentScript.js Ver fichero

@@ -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();
});
}

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

Cargando…
Cancelar
Guardar