Fix Haaretz Group (anti-adblocker)

This commit is contained in:
magnolia1234 2024-03-21 12:04:35 +01:00
parent 3931fb846d
commit 137fcd525c
6 changed files with 35 additions and 5 deletions

View file

@ -6,6 +6,7 @@ Post-release
Add Blick.ch (Ringier Gruppe)
Add CNN (regwall)
Fix Expresso.pt (json)
Fix Haaretz Group (anti-adblocker)
Fix Newsweek.pl (css)
Fix The Athletic (scroll)

View file

@ -4341,6 +4341,15 @@ else if (matchDomain(['haaretz.co.il', 'haaretz.com', 'themarker.com'])) {
let article_sel = 'div[data-test="articleBody"], ' + body_wrapper_sel;
let article_link_sel = 'article header, main.article-page p, ' + article_sel;
if (window.location.pathname.includes('/.')) {
let page_script = document.querySelector('script[src*="/page-"]');
if (page_script) {
let disabled_items = document.querySelectorAll('section[data-testid="zoidberg-list"], section#comments-section');
hideDOMElement(...disabled_items);
let noprint = document.querySelectorAll('div.no-print');
for (let elem of noprint)
if (!elem.hasChildNodes())
hideDOMElement(elem);
}
func_post = function () {
let article_link = document.querySelector(article_link_sel);
if (article_link) {
@ -4372,6 +4381,13 @@ else if (matchDomain(['haaretz.co.il', 'haaretz.com', 'themarker.com'])) {
let inert_links = document.querySelectorAll('article[inert]');
for (let elem of inert_links)
elem.removeAttribute('inert');
} else if (window.location.pathname === '/error') {
window.setTimeout(function () {
let params = new URL(window.location).searchParams;
let path = params.get('path');
if (path)
window.location.pathname = path;
}, 500);
}
}
@ -6404,7 +6420,7 @@ function clearPaywall(paywall, paywall_action) {
function getGoogleWebcache(url, paywall_sel, paywall_action = '', selector, selector_source = selector) {
let url_cache = 'https://webcache.googleusercontent.com/search?q=cache:' + url.split(/[#\?]/)[0];
let paywall = document.querySelectorAll(paywall_sel);
if (paywall.length) {
if (paywall.length && dompurify_loaded) {
clearPaywall(paywall, paywall_action);
csDoneOnce = true;
replaceDomElementExt(url_cache, true, false, selector, '', selector_source);
@ -6414,7 +6430,7 @@ function getGoogleWebcache(url, paywall_sel, paywall_action = '', selector, sele
function getArchive(url, paywall_sel, paywall_action = '', selector, text_fail = '', selector_source = selector, selector_archive = selector) {
let url_archive = 'https://' + archiveRandomDomain() + '/' + url.split(/[#\?]/)[0];
let paywall = document.querySelectorAll(paywall_sel);
if (paywall.length) {
if (paywall.length && dompurify_loaded) {
clearPaywall(paywall, paywall_action);
csDoneOnce = true;
replaceDomElementExt(url_archive, true, false, selector, text_fail, selector_source, selector_archive);

View file

@ -51,5 +51,5 @@
"webRequestBlocking",
"*://*/*"
],
"version": "3.6.0.3"
"version": "3.6.0.4"
}

View file

@ -862,5 +862,5 @@
"*://archive.vn/*",
"*://webcache.googleusercontent.com/*"
],
"version": "3.6.0.3"
"version": "3.6.0.4"
}

View file

@ -1108,7 +1108,7 @@ var defaultSites = {
"themarker.com"
],
allow_cookies: 1,
block_regex: /\.co(m|\.il)\/.+\/magazine\/page-.+\.js/,
block_regex: "{domain}\\/.+\\/page-.+\\.js",
cs_dompurify: 1,
useragent_custom: "Mozilla/5.0 (Java) outbrain"
},

View file

@ -30,6 +30,19 @@
"ld_archive_is": "div#paywall-container|article",
"upd_version": "3.5.8.3"
},
"Haaretz Group": {
"domain": "###_il_haaretz_group",
"group": [
"haaretz.co.il",
"haaretz.com",
"themarker.com"
],
"allow_cookies": 1,
"block_regex": "{domain}\\/.+\\/page-.+\\.js",
"cs_dompurify": 1,
"useragent_custom": "Mozilla/5.0 (Java) outbrain",
"upd_version": "3.6.0.4"
},
"Hearst Communications (newspapers)": {
"domain": "###_usa_hearst_comm",
"group": [