diff --git a/src/contentScript.js b/src/contentScript.js index e4b061a..0a3e34d 100644 --- a/src/contentScript.js +++ b/src/contentScript.js @@ -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) { diff --git a/src/platform/chrome/manifest.json b/src/platform/chrome/manifest.json index cdf0255..92dbcfa 100644 --- a/src/platform/chrome/manifest.json +++ b/src/platform/chrome/manifest.json @@ -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", diff --git a/src/platform/firefox/manifest.json b/src/platform/firefox/manifest.json index 4c63210..01e65f0 100644 --- a/src/platform/firefox/manifest.json +++ b/src/platform/firefox/manifest.json @@ -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": {