From eab683a2e42db408136663310f58ec4db511eb94 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Thu, 25 Aug 2022 21:27:34 +0200 Subject: [PATCH] Fix NYTimes (Cooking) --- changelog.txt | 1 + contentScript.js | 26 ++------------------------ custom/manifest.json | 2 +- custom/sites_custom.json | 10 ++++++++++ manifest.json | 2 +- sites.js | 2 +- sites_updated.json | 5 +++++ 7 files changed, 21 insertions(+), 27 deletions(-) diff --git a/changelog.txt b/changelog.txt index d37843a..1490825 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,6 +4,7 @@ Changelog Bypass Paywalls Clean - Chrome Post-release Add New Scientist Fix Los Angeles Times & San Diego Union-Tribune +Fix NYTimes (Cooking) Fix The New York Review of Books (timing) * v2.8.1.0 (2022-08-21) diff --git a/contentScript.js b/contentScript.js index 14ab4ae..83f029c 100755 --- a/contentScript.js +++ b/contentScript.js @@ -3230,30 +3230,8 @@ else if (matchDomain('nybooks.com')) { } else if (matchDomain('nytimes.com')) { - function nyt_main() { - navigator.storage.estimate = undefined; - webkitRequestFileSystem = function () {}; - } - insert_script(nyt_main); - let preview_button = document.querySelector('.css-3s1ce0'); - if (preview_button) - preview_button.click(); - if (window.location.hostname === 'cooking.nytimes.com') { - let no_scroll = document.querySelectorAll('.nytc---modal-window---noScroll'); - for (let elem of no_scroll) - elem.classList.remove('nytc---modal-window---noScroll'); - let login = document.querySelector('div[class*="modal_modal-window-container"]:not([style="display:none;"])'); - if (login) { - let close_button = login.querySelector('span[aria-label="close"]'); - if (!close_button) - login.style = 'display:none;'; - } - } else { - waitDOMElement('div[data-testid="inline-message"]', 'DIV', removeDOMElement, false); - waitDOMElement('div[id^="ad-"]', 'DIV', removeDOMElement, false); - waitDOMElement('div.expanded-dock', 'DIV', removeDOMElement, false); - csDoneOnce = true; - } + let banners = document.querySelectorAll('div[data-testid="inline-message"], div[id^="ad-"], div.expanded-dock'); + removeDOMElement(...banners); } else if (matchDomain('nzherald.co.nz')) { diff --git a/custom/manifest.json b/custom/manifest.json index dacb97b..12fb909 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -43,5 +43,5 @@ "webRequestBlocking", "" ], - "version": "2.8.1.3" + "version": "2.8.1.4" } diff --git a/custom/sites_custom.json b/custom/sites_custom.json index cafccf7..e5cab7a 100644 --- a/custom/sites_custom.json +++ b/custom/sites_custom.json @@ -106,6 +106,11 @@ "block_regex": "\\.tinypass\\.com\\/", "domain": "nationalobserver.com" }, + "Nv.ua": { + "allow_cookies": 1, + "amp_redirect": "div[id^=\"media_paywall\"]", + "domain": "nv.ua" + }, "Physicsworld.com": { "domain": "physicsworld.com" }, @@ -180,5 +185,10 @@ "allow_cookies": 1, "block_regex": "\\.tinypass\\.com\\/", "domain": "toledoblade.com" + }, + "Vigilantcitizen.com": { + "allow_cookies": 1, + "domain": "vigilantcitizen.com", + "random_ip": "all" } } diff --git a/manifest.json b/manifest.json index 7c93b8e..60c4954 100755 --- a/manifest.json +++ b/manifest.json @@ -686,5 +686,5 @@ "*://gcm.omerlocdn.com/*", "*://webcache.googleusercontent.com/*" ], - "version": "2.8.1.3" + "version": "2.8.1.4" } diff --git a/sites.js b/sites.js index 12a0739..ac7b4b3 100755 --- a/sites.js +++ b/sites.js @@ -1781,7 +1781,7 @@ var defaultSites = { "The New York Times": { domain: "nytimes.com", allow_cookies: 1, - block_regex: /(meter-svc\.nytimes\.com\/meter\.js|mwcm\.nyt\.com\/.+\.js)/ + block_regex: /(meter-svc\.nytimes\.com\/meter\.js|mwcm\.nyt\.com\/.+\.js|cooking\.nytimes\.com\/api\/.+\/access)/ }, "The Philadelphia Inquirer": { domain: "inquirer.com", diff --git a/sites_updated.json b/sites_updated.json index 520108a..e274dc1 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -59,5 +59,10 @@ "domain": "nybooks.com", "allow_cookies": 1, "block_regex": "\\.nybooks\\.com\\/wp-admin\\/admin-ajax\\.php" + }, + "The New York Times": { + "domain": "nytimes.com", + "allow_cookies": 1, + "block_regex": "(meter-svc\\.nytimes\\.com\\/meter\\.js|mwcm\\.nyt\\.com\\/.+\\.js|cooking\\.nytimes\\.com\\/api\\/.+\\/access)" } }