From 7c6df95947ed539e9523fce4f3b49fb0b234700b Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Mon, 17 Jan 2022 19:05:26 +0100 Subject: [PATCH] Fix The New Yorker (update) --- background.js | 2 +- changelog.txt | 1 + contentScript.js | 29 +---------------------------- manifest.json | 3 +-- sites.js | 22 +++++++++++++++------- 5 files changed, 19 insertions(+), 38 deletions(-) diff --git a/background.js b/background.js index 94cc648..4981c10 100644 --- a/background.js +++ b/background.js @@ -980,7 +980,7 @@ if (matchUrlDomain(change_headers, details.url) && !['font', 'image', 'styleshee } if ((!['font', 'stylesheet'].includes(details.type) || matchUrlDomain(cs_limit_except, currentTabUrl)) && !csDone) { let lib_file = 'lib/empty.js'; - if (matchUrlDomain(['bloomberg.com', 'cicero.de', 'economictimes.com', 'hs.fi', 'lesechos.fr', 'marianne.net', 'newleftreview.org', 'newyorker.com', 'nzherald.co.nz', 'prospectmagazine.co.uk', 'stratfor.com', 'sudouest.fr', 'techinasia.com', 'timesofindia.com', 'valor.globo.com', 'vn.nl'].concat(nl_mediahuis_region_domains, no_nhst_media_domains, usa_theathletic_domains), currentTabUrl)) + if (matchUrlDomain(['bloomberg.com', 'cicero.de', 'economictimes.com', 'hs.fi', 'lesechos.fr', 'marianne.net', 'newleftreview.org', 'nzherald.co.nz', 'prospectmagazine.co.uk', 'stratfor.com', 'sudouest.fr', 'techinasia.com', 'timesofindia.com', 'valor.globo.com', 'vn.nl'].concat(nl_mediahuis_region_domains, no_nhst_media_domains, usa_theathletic_domains), currentTabUrl)) lib_file = 'lib/purify.min.js'; var bg2csData = { optin_setcookie: optin_setcookie, diff --git a/changelog.txt b/changelog.txt index 1bc3819..9cef5c4 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ Changelog Bypass Paywalls Clean - Firefox Post-release +Fix The New Yorker (update) * v2.5.2.0 (2022-01-16) Add Mainichi Shimbun (Japan) diff --git a/contentScript.js b/contentScript.js index fceceaf..ed8c0c5 100644 --- a/contentScript.js +++ b/contentScript.js @@ -2625,26 +2625,12 @@ else if (matchDomain('newsday.com')) { } } - -else if (matchDomain('newyorker.com') && window.location.pathname.length > 1) { +else if (matchDomain(['newyorker.com', 'vanityfair.com', 'wired.com'])) { if (window.location.pathname.endsWith('/amp')) { amp_unhide_subscr_section('.ad'); } else { let paywall_bar = document.querySelector('.paywall-bar'); removeDOMElement(paywall_bar); - let invisible_assets = document.querySelectorAll('.responsive-asset--invisible'); - for (let asset_invisible of invisible_assets) - asset_invisible.classList.remove('responsive-asset--invisible'); - let overlays = document.querySelectorAll('.aspect-ratio--overlay-container, .asset-embed__asset-container'); - let parser = new DOMParser(); - for (let overlay of overlays) { - let noscript = overlay.querySelector('noscript'); - if (noscript && noscript.innerHTML && dompurify_loaded) { - let html = parser.parseFromString(DOMPurify.sanitize(noscript.innerHTML), 'text/html'); - overlay.appendChild(html.querySelector('img')); - removeDOMElement(noscript); - } - } } } @@ -3195,12 +3181,6 @@ else if (matchDomain('usatoday.com')) { } } -else if (matchDomain('vanityfair.com')) { - if (window.location.pathname.endsWith('/amp')) { - amp_unhide_subscr_section(); - } -} - else if (matchDomain('velonews.com')) { let paywall = document.querySelector('div.o-membership-overlay'); if (paywall) { @@ -3239,13 +3219,6 @@ else if (matchDomain('washingtonpost.com')) { } } -else if (matchDomain('wired.com')) { - let url = window.location.href.split('?')[0]; - if (url.endsWith('/amp')) { - amp_unhide_subscr_section(); - } -} - else if (matchDomain('wsj.com')) { let url = window.location.href; if (location.href.includes('/articles/')) { diff --git a/manifest.json b/manifest.json index 4cdc5e3..10ca8e7 100644 --- a/manifest.json +++ b/manifest.json @@ -587,7 +587,6 @@ "*://*.flip-pay.com/*", "*://*.gannett-cdn.com/*", "*://*.hearstnp.com/*", - "*://*.htmedia.in/*", "*://*.jsdelivr.net/*", "*://*.lightboxcdn.com/*", "*://*.loader-cdn.azureedge.net/*", @@ -603,5 +602,5 @@ "*://*.wsj.net/*", "*://*.zephr.com/*" ], - "version": "2.5.2.0" + "version": "2.5.2.1" } diff --git a/sites.js b/sites.js index eb00280..7124a03 100644 --- a/sites.js +++ b/sites.js @@ -911,7 +911,7 @@ var defaultSites = { "tulsaworld.com" ], allow_cookies: 1, - block_regex: /(api\.bntech\.io\/js\/|cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad)-.+\.js)/ + block_regex: /(api\.bntech\.io\/js\/|\.com\/shared-content\/art\/tncms\/user\/user\.js|cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad)-.+\.js)/ }, "Leeuwarder Courant": { domain: "lc.nl", @@ -938,7 +938,8 @@ var defaultSites = { }, "LiveMint": { domain: "livemint.com", - block_regex: /(\.livemint\.com\/js\/localWorker\.js|analytics\.htmedia\.in\/analytics-js\/.+\.js|cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad)-.+\.js)/ + allow_cookies: 1, + block_regex: /(\.livemint\.com\/__js\/lm_subscription_.+\.js|cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad)-.+\.js)/ }, "Loeb Classical Library": { domain: "loebclassics.com" @@ -1426,7 +1427,8 @@ var defaultSites = { block_regex: /\.businessoffashion\.com\/zephr\/feature-decisions/ }, "The Christian Science Monitor": { - domain: "csmonitor.com" + domain: "csmonitor.com", + allow_cookies: 1 }, "The Daily Beast": { domain: "thedailybeast.com", @@ -1544,7 +1546,7 @@ var defaultSites = { }, "The New Yorker": { domain: "newyorker.com", - block_regex: /(\.newyorker\.com\/verso\/static\/presenter-articles.+\.js|cdn\.ampproject\.org\/v\d\/amp-(ad|subscriptions)-.+\.js)/ + group_rule: "###_gr_usa_conde_nast_domains" }, "The Philadelphia Inquirer": { domain: "inquirer.com", @@ -1581,6 +1583,7 @@ var defaultSites = { }, "The Telegraph": { domain: "telegraph.co.uk", + allow_cookies: 1, block_regex: /(\.tinypass\.com\/|cdn\.ampproject\.org\/v\d\/amp-(access|ad)-.+\.js|\.telegraph\.co\.uk\/.+\/piano.+\.js|assets\.adobedtm\.com\/.+\.js)/ }, "The Times": { @@ -1693,7 +1696,7 @@ var defaultSites = { }, "Vanity Fair": { domain: "vanityfair.com", - block_regex: /cdn\.ampproject\.org\/v\d\/amp-(ad|subscriptions)-.+\.js/ + group_rule: "###_gr_usa_conde_nast_domains" }, "Variety": { domain: "variety.com", @@ -1739,8 +1742,7 @@ var defaultSites = { }, "Wired": { domain: "wired.com", - block_regex: /cdn\.ampproject\.org\/v\d\/amp-(ad|subscriptions)-.+\.js/, - useragent: "googlebot" + group_rule: "###_gr_usa_conde_nast_domains" }, "World Politics Review": { domain: "worldpoliticsreview.com", @@ -1767,6 +1769,12 @@ var defaultSites = { remove_cookies_select_drop: ["TID_ID"], block_regex: "\\.{domain}\\/temptation\\/resolve" }, + "###_gr_usa_conde_nast_domains": { + group_rule_domains: ["newyorker.com", "vanityfair.com", "wired.com"], + remove_cookies_select_drop: ["pay_ent_smp"], + block_regex: "(journey\\.{domain}\\/build-.+\\.js|cdn\\.ampproject\\.org\\/v\\d\\/amp-(ad|subscriptions)-.+\\.js)", + useragent: "googlebot" + }, "###_gr_usa_genomeweb_domains": { group_rule_domains: ["genomeweb.com", "360dx.com", "precisiononcologynews.com"], allow_cookies: 1,