|
|
|
@@ -59,14 +59,7 @@ function checkForShouldKillSticky(result) { |
|
|
|
function startConstantVigilance() { |
|
|
|
var observer = new MutationObserver((mutationsList, observer) => { |
|
|
|
for (var mutation of mutationsList) { |
|
|
|
if (getComputedStyle(mutation.target).position == 'fixed' || |
|
|
|
getComputedStyle(mutation.target).position == 'sticky') { |
|
|
|
mutation.target.remove(); |
|
|
|
console.log("Killing a sticky!"); |
|
|
|
|
|
|
|
// Compensate for fullscreen paywalls. |
|
|
|
restoreScrollability(); |
|
|
|
} |
|
|
|
killSticky(mutation.target); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
@@ -87,13 +80,14 @@ function initialize() { |
|
|
|
let shouldKillSticky = checkForShouldKillSticky(result); |
|
|
|
updateIcon(shouldKillSticky); |
|
|
|
if (shouldKillSticky) { |
|
|
|
startConstantVigilance(); |
|
|
|
function beginKillingStickies() { |
|
|
|
killSticky(); |
|
|
|
startConstantVigilance(); |
|
|
|
} |
|
|
|
if (document.readyState == "loading") { |
|
|
|
document.addEventListener("DOMContentLoaded", () => { |
|
|
|
killSticky(); |
|
|
|
}); |
|
|
|
document.addEventListener("DOMContentLoaded", beginKillingStickies); |
|
|
|
} else { |
|
|
|
killSticky(); |
|
|
|
beginKillingStickies(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |