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) {
|
function killSticky(root) {
|
||||||
// console.log("killSticky");
|
// console.log("killSticky");
|
||||||
root = root || document.querySelector("body");
|
root = root || document.querySelector("body");
|
||||||
if (killStickyIfNeeded(root) == false) {
|
if (killStickyIfNeeded(root) == false)
|
||||||
root.querySelectorAll('*').forEach(element => {
|
killAllStickiesWithin(root);
|
||||||
killStickyIfNeeded(element)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Compensate for full-screen paywalls.
|
// 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) {
|
function killStickyIfNeeded(element) {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "AlwaysKillSticky",
|
"name": "AlwaysKillSticky",
|
||||||
"version": "1.2.9",
|
"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",
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "AlwaysKillSticky",
|
"name": "AlwaysKillSticky",
|
||||||
"version": "1.2.9",
|
"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": {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user