Compare commits
3 Commits
2ecd4edcb7
...
c98ca80bbf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c98ca80bbf | ||
|
|
0b3b0a2c58 | ||
|
|
36951432cf |
@ -166,20 +166,30 @@ function restoreScrollability() {
|
||||
*/
|
||||
function startConstantVigilance() {
|
||||
// console.log("startConstantVigilance");
|
||||
var observer = new MutationObserver((mutationsList, observer) => {
|
||||
window.requestIdleCallback(() => {
|
||||
for (var mutation of mutationsList) {
|
||||
killSticky(mutation.target);
|
||||
}
|
||||
var 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(() => {
|
||||
killSticky();
|
||||
starter();
|
||||
}, {timeout: 1000});
|
||||
});
|
||||
|
||||
console.log("Commencing vigilance for stickies!");
|
||||
observer.observe(document.querySelector("html"), {
|
||||
attributes: true,
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
starter();
|
||||
}
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
@ -192,7 +202,7 @@ function beginKillingStickies() {
|
||||
window.requestIdleCallback(() => {
|
||||
killSticky();
|
||||
startConstantVigilance();
|
||||
});
|
||||
}, {timeout: 1000});
|
||||
}
|
||||
|
||||
/******************/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"manifest_version": 2,
|
||||
"name": "AlwaysKillSticky",
|
||||
"version": "1.3.0",
|
||||
"version": "1.3.1",
|
||||
"description": "Get rid of sticky elements on websites - permanently!",
|
||||
"author": "Said Achmiz",
|
||||
"homepage_url": "https://git.sr.ht/~achmizs/AlwaysKillSticky.git",
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"manifest_version": 2,
|
||||
"name": "AlwaysKillSticky",
|
||||
"version": "1.3.0",
|
||||
"version": "1.3.1",
|
||||
"description": "Get rid of sticky elements on websites - permanently!",
|
||||
"author": "Said Achmiz",
|
||||
"browser_specific_settings": {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user