Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
Adjust to modifications of seekingalpha HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
krisztianb committed Aug 15, 2024
1 parent ba08bec commit f16bd0a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Seeking Alpha Paywall Remover",
"version": "1.3",
"version": "1.4",
"description": "Removes the paywall from news and article pages on the seekingalpha.com website",
"icons": {
"48": "icons/48x48.png",
Expand Down
14 changes: 10 additions & 4 deletions paywall-remover.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const payWallSelector = 'div:has(> div[role="dialog"])';
const payWallSelector = "main + div > div + div";
const overlaySelector = "div.bg-black\\/30";
const contentWrapperSelector = "#content";
const articleSelector = "main article section";

Expand Down Expand Up @@ -28,9 +29,14 @@ new window.MutationObserver(function (mutations) {
}).observe(document, { subtree: true, attributes: true });

function hidePayWall() {
const payWallOverlay = document.querySelector(payWallSelector);
if (payWallOverlay) {
payWallOverlay.setAttribute("style", "display:none");
const payWallDialog = document.querySelector(payWallSelector);
if (payWallDialog) {
payWallDialog.setAttribute("style", "display:none");
}

const overlay = document.querySelector(overlaySelector);
if (overlay) {
overlay.remove();
}
}

Expand Down

0 comments on commit f16bd0a

Please sign in to comment.