diff --git a/changelog.txt b/changelog.txt index f80d7759..972b9eae 100644 --- a/changelog.txt +++ b/changelog.txt @@ -12,6 +12,7 @@ Fix Grupo Abril (js) Fix Haaretz Group (anti-adblocker) Fix LesEchos.fr Fix TopAgrar (js-inline) +Fix WSJ Pro (fetch from archive.is) * v3.5.2.0 (2024-01-21) Add Hln.be (fetch from archive.is) diff --git a/contentScript.js b/contentScript.js index 148b7e94..57804c0e 100644 --- a/contentScript.js +++ b/contentScript.js @@ -5558,34 +5558,28 @@ else if (matchDomain('wsj.com')) { if (masthead_link) masthead_link.href = 'https://www.wsj.com'; } else { - let snippet = document.querySelector('.snippet-promotion, div#cx-snippet-overlay'); - if (snippet) { - removeDOMElement(snippet); + let paywall_sel = '.snippet-promotion, div#cx-snippet-overlay'; + let paywall = document.querySelector(paywall_sel); + if (paywall) { if (!matchDomain('www.wsj.com')) { + removeDOMElement(paywall); if (url_article) window.location.href = window.location.href.replace('wsj.com', 'wsj.com/amp'); else window.location.href = '/amp/articles/' + path_article[0]; - } else { - let wsj_pro = snippet.querySelector('a[href^="https://wsjpro.com/"]'); - let article = document.querySelector('article'); - if (article) { - window.setTimeout(function () { - if (wsj_pro) { - article.firstChild.before(googleSearchToolLink(window.location.href)); - article.firstChild.before(archiveLink(window.location.href, 'BPC > Try for full article text (articles before 2023-10-28)')); - } else - article.firstChild.before(archiveLink(window.location.href)); - }, 500); - csDoneOnce = true; - waitDOMElement('div.paywall', 'DIV', node => hideDOMElement(...document.querySelectorAll('div#bpc_archive')), false); - } + } else if (dompurify_loaded) { + let url = window.location.href; + let article_sel = 'article section'; + let wsj_pro = paywall.querySelector('a[href^="https://wsjpro.com/"]'); + if (wsj_pro) + article_sel = 'article'; + getArchive(url, paywall_sel, '', article_sel); } } } } } - let ads = document.querySelectorAll('div.wsj-ad, div.adWrapper, div.uds-ad-container'); + let ads = document.querySelectorAll('div.wsj-ad, div.adWrapper, div.uds-ad-container, div.css-xgokil-Box'); hideDOMElement(...ads); } diff --git a/custom/manifest.json b/custom/manifest.json index cad4c4b4..408b7739 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -51,5 +51,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.5.2.6" + "version": "3.5.2.7" } diff --git a/custom/sites_custom.json b/custom/sites_custom.json index e86da5e5..215c6d24 100644 --- a/custom/sites_custom.json +++ b/custom/sites_custom.json @@ -261,6 +261,12 @@ "domain": "gramophone.co.uk", "useragent": "googlebot" }, + "Group_de_ozg": { + "allow_cookies": 1, + "domain": "group_de_ozg", + "group": "borkumer-zeitung.de,ga-online.de,on-online.de,oz-online.de", + "ld_json": "div.paywall|div.pointer-events-none" + }, "Group_media_source_inc": { "allow_cookies": 1, "block_regex": "\\.com\\/.+\\/js\\/metering\\.js", @@ -273,6 +279,12 @@ "domain": "group_nation_media", "group": "monitor.co.ug,nation.africa,thecitizen.co.tz" }, + "Group_van_magazine": { + "allow_cookies": 1, + "domain": "group_van_magazine", + "group": "van-magazine.com,van-magazin.de", + "ld_json_url": "div.newspack-metered-paywall-block|div.entry-content" + }, "Hartenergy.com": { "allow_cookies": 1, "block_regex": "js\\.pelcro\\.com", @@ -512,11 +524,6 @@ "cs_code": "[{\"cond\":\"div[property='content:encoded']\", \"rm_attrib\":\"property\"}]", "domain": "odt.co.nz" }, - "On-online.de": { - "allow_cookies": 1, - "domain": "on-online.de", - "ld_json": "div.paywall|div.pointer-events-none" - }, "Onet.pl": { "allow_cookies": 1, "domain": "onet.pl", @@ -533,11 +540,6 @@ "cs_code": "[{\"cond\":\"div.id-TBeepSlot\", \"rm_elem\":1}]", "domain": "ovb-online.de" }, - "Oz-online.de": { - "allow_cookies": 1, - "domain": "oz-online.de", - "ld_json": "div.paywall|div.pointer-events-none" - }, "Pebmed.com.br": { "allow_cookies": 1, "block_regex": "\\/pebmed\\.com\\.br\\/wp-content\\/.+\\/paywall\\/dist\\/js\\/app\\.js", @@ -814,16 +816,6 @@ "domain": "utilityweek.co.uk", "useragent": "googlebot" }, - "Van-magazin.de": { - "allow_cookies": 1, - "domain": "van-magazin.de", - "ld_json_url": "div.newspack-metered-paywall-block|div.entry-content" - }, - "Van-magazine.com": { - "allow_cookies": 1, - "domain": "van-magazine.com", - "ld_json_url": "div.newspack-metered-paywall-block|div.entry-content" - }, "Washingtontimes.com": { "allow_cookies": 1, "block_regex": "\\.tinypass\\.com", diff --git a/manifest.json b/manifest.json index e66c5134..e4054f9b 100644 --- a/manifest.json +++ b/manifest.json @@ -841,5 +841,5 @@ "*://archive.vn/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.5.2.6" + "version": "3.5.2.7" } diff --git a/sites.js b/sites.js index 30c74235..30916a6b 100644 --- a/sites.js +++ b/sites.js @@ -2577,7 +2577,8 @@ var defaultSites = { allow_cookies: 1, block_regex: /(cdn\.cxense\.com\/|cdn\.ampproject\.org\/v\d\/amp-subscriptions-.+\.js)/, referer: "drudgereport", - useragent: "googlebot" + useragent: "googlebot", + cs_dompurify: 1 }, "The Washington Post": { domain: "washingtonpost.com",