Compare commits

..

No commits in common. "c98ca80bbfc0d58f544a1fa8ff7db28b50f9897d" and "2ecd4edcb7df6c145f896a73f53d5dabb3a2e531" have entirely different histories.

3 changed files with 13 additions and 23 deletions

View File

@ -166,30 +166,20 @@ function restoreScrollability() {
*/ */
function startConstantVigilance() { function startConstantVigilance() {
// console.log("startConstantVigilance"); // console.log("startConstantVigilance");
var observer; var observer = new MutationObserver((mutationsList, observer) => {
var starter = function() {
observer.observe(document.querySelector("html"), {
attributes: true,
childList: true,
subtree: true
});
};
observer = new MutationObserver((mutationsList, observer) => {
// Workaround for Firefox performance bug. Firefox does not properly
// coalesce mutations into the mutationsList, instead calling the
// callback potentially thousands of times. Therefore we must
// disconnect the observer, wait for the main thread to become idle,
// and then restart it.
observer.disconnect();
window.requestIdleCallback(() => { window.requestIdleCallback(() => {
killSticky(); for (var mutation of mutationsList) {
starter(); killSticky(mutation.target);
}, {timeout: 1000}); }
});
}); });
console.log("Commencing vigilance for stickies!"); console.log("Commencing vigilance for stickies!");
starter(); observer.observe(document.querySelector("html"), {
attributes: true,
childList: true,
subtree: true
});
} }
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
@ -202,7 +192,7 @@ function beginKillingStickies() {
window.requestIdleCallback(() => { window.requestIdleCallback(() => {
killSticky(); killSticky();
startConstantVigilance(); startConstantVigilance();
}, {timeout: 1000}); });
} }
/******************/ /******************/

View File

@ -1,7 +1,7 @@
{ {
"manifest_version": 2, "manifest_version": 2,
"name": "AlwaysKillSticky", "name": "AlwaysKillSticky",
"version": "1.3.1", "version": "1.3.0",
"description": "Get rid of sticky elements on websites - permanently!", "description": "Get rid of sticky elements on websites - permanently!",
"author": "Said Achmiz", "author": "Said Achmiz",
"homepage_url": "https://git.sr.ht/~achmizs/AlwaysKillSticky.git", "homepage_url": "https://git.sr.ht/~achmizs/AlwaysKillSticky.git",

View File

@ -1,7 +1,7 @@
{ {
"manifest_version": 2, "manifest_version": 2,
"name": "AlwaysKillSticky", "name": "AlwaysKillSticky",
"version": "1.3.1", "version": "1.3.0",
"description": "Get rid of sticky elements on websites - permanently!", "description": "Get rid of sticky elements on websites - permanently!",
"author": "Said Achmiz", "author": "Said Achmiz",
"browser_specific_settings": { "browser_specific_settings": {