Added support for killing stickies within shadow DOMs
This commit is contained in:
parent
68884dcd03
commit
2ecd4edcb7
@ -61,14 +61,19 @@ function checkForShouldKillSticky(result) {
|
||||
function killSticky(root) {
|
||||
// console.log("killSticky");
|
||||
root = root || document.querySelector("body");
|
||||
if (killStickyIfNeeded(root) == false) {
|
||||
root.querySelectorAll('*').forEach(element => {
|
||||
killStickyIfNeeded(element)
|
||||
});
|
||||
}
|
||||
if (killStickyIfNeeded(root) == false)
|
||||
killAllStickiesWithin(root);
|
||||
|
||||
// Compensate for full-screen paywalls.
|
||||
restoreScrollability();
|
||||
if (root == document.body)
|
||||
restoreScrollability();
|
||||
}
|
||||
|
||||
function killAllStickiesWithin(root) {
|
||||
root.querySelectorAll('*').forEach(element => {
|
||||
if (killStickyIfNeeded(element) == false && element.shadowRoot != null)
|
||||
killAllStickiesWithin(element.shadowRoot);
|
||||
});
|
||||
}
|
||||
|
||||
function killStickyIfNeeded(element) {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"manifest_version": 2,
|
||||
"name": "AlwaysKillSticky",
|
||||
"version": "1.2.9",
|
||||
"version": "1.3.0",
|
||||
"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.2.9",
|
||||
"version": "1.3.0",
|
||||
"description": "Get rid of sticky elements on websites - permanently!",
|
||||
"author": "Said Achmiz",
|
||||
"browser_specific_settings": {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user