From eddd18ef2f3d83c330bf7529de94ae925b37d5a9 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sun, 4 Oct 2020 08:46:29 +0200 Subject: [PATCH] Fix-update The Hindu (menu) --- README.md | 3 ++- background.js | 5 ++++- changelog.txt | 1 + contentScript.js | 22 ++++++++++++++-------- lp/manifest.json | 3 +-- manifest.json | 2 +- 6 files changed, 23 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 86e898c..ebc05e8 100755 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Visit the [Firefox repository](https://bitbucket.org/magnolia1234/bypass-paywall #### Notes * This extension works best alongside the adblocker [uBlock Origin](https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm?hl=en). * On Yandex Android use [uBlock Origin development build](https://chrome.google.com/webstore/detail/ublock-origin-dev-build/cgbcahbpdhpcegmbfconppldiemgcoii). -* If you live in the EU, also consider installing the extension [I don't care about cookies](https://chrome.google.com/webstore/detail/i-dont-care-about-cookies/fihnjjcciajhdojfnbdddfaoknhalnja) in order to remove cookie warnings (or add filter [Easylist Cookies](abp:subscribe?location=https://easylist-downloads.adblockplus.org/easylist-cookie.txt&title=EasyList%20Cookie%20List) | [I don't care about cookies custom filter](abp:subscribe?location=https%3A%2F%2Fwww.i-dont-care-about-cookies.eu%2Fabp%2F&title=I%20don%27t%20care%20about%20cookies) to uBlock Origin). +* If you live in the EU, also consider installing the extension [I don't care about cookies](https://chrome.google.com/webstore/detail/i-dont-care-about-cookies/fihnjjcciajhdojfnbdddfaoknhalnja) in order to remove cookie warnings (or add filter [Easylist Cookies](https://easylist-downloads.adblockplus.org/easylist-cookie.txt) | [I don't care about cookies custom filter](https://www.i-dont-care-about-cookies.eu/abp) to uBlock Origin). * Do not delete extension's folder from your computer/smartphone or Bypass Paywalls Clean (in developer mode) will disappear at restart. * Every time you open Chrome it may warn you about running extensions in developer mode, just close the popup to keep the extension enabled. * You will be logged out for most of the sites you have checked. @@ -388,6 +388,7 @@ Also you can enable Googlebot user-agent or disable Javascript for (sub)domain(s ### Troubleshooting * This extension works best alongside [uBlock Origin](https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm). +* If a site doesn't work, try turning off uBlock and refreshing. * Make sure the (new) site is checked under Options. * Make sure you're running the last version of Bypass Paywalls Clean. * If none of these work, you can submit an issue [here](https://bitbucket.org/magnolia1234/bypass-paywalls-chrome-clean/issues). diff --git a/background.js b/background.js index 60d898d..7622570 100755 --- a/background.js +++ b/background.js @@ -60,6 +60,7 @@ var allow_cookies = [ 'newrepublic.com', 'nknews.org', 'noordhollandsdagblad.nl', +'nrz.de', 'nytimes.com', 'nzz.ch', 'parool.nl', @@ -82,6 +83,8 @@ var allow_cookies = [ 'washingtonpost.com', 'waz.de', 'worldpoliticsreview.com', +'wp.de', +'wr.de', 'zeit.de', ] @@ -226,7 +229,7 @@ var blockedRegexes = { 'telegraph.co.uk': /.+\.tinypass\.com\/.+/, 'theage.com.au': /cdn\.ampproject\.org\/v\d\/amp-subscriptions-.+\.js/, 'thedailybeast.com': /.+\.tinypass\.com\/.+/, -'thehindu.com': /ajax\.cloudflare\.com\/cdn-cgi\/scripts\/.+\/cloudflare-static\/rocket-loader\.min\.js/, +'thehindu.com': /(cdn\.cxense\.com|.+\.tinypass\.com\/.+)/, 'thenation.com': /.+\.tinypass\.com\/.+/, 'valeursactuelles.com': /.+\.qiota\.com\/.+/, 'variety.com': /cdn\.cxense\.com/, diff --git a/changelog.txt b/changelog.txt index a41bd26..5a820a4 100644 --- a/changelog.txt +++ b/changelog.txt @@ -11,6 +11,7 @@ Add Westfaelische Rundschau Fix-update Australian Financial Review (images) Fix-update Domani (Italy) Fix-update Globe and Mail (FF for Android v68) +Fix-update The Hindu (menu) Fix-update WSJ Add whitelist for BPC extension Fix custom sites Googlebot-fix (after reload) diff --git a/contentScript.js b/contentScript.js index 5b9cf44..a83837b 100755 --- a/contentScript.js +++ b/contentScript.js @@ -3,7 +3,7 @@ var ext_api = (typeof browser === 'object') ? browser : chrome; var domain; // clean local storage of sites (with an exemption for hold-list) -var arr_localstorage_hold = ['elmundo.es', 'nknews.org', 'seekingalpha.com', 'sfchronicle.com', 'waz.de']; +var arr_localstorage_hold = ['elmundo.es', 'nknews.org', 'nrz.de', 'seekingalpha.com', 'sfchronicle.com', 'thehindu.com', 'waz.de', 'wp.de', 'wr.de']; if (!matchDomain(arr_localstorage_hold)){ window.localStorage.clear(); } @@ -269,12 +269,18 @@ else if (matchDomain('ft.com')) { } else if (matchDomain("thehindu.com")) { - document.addEventListener('DOMContentLoaded', () => { - let counter = document.querySelector('#test'); - let co_banner = document.querySelector('.co-banner'); - let support = document.querySelector('div.support-jlm'); - removeDOMElement(counter, co_banner, support); - }); + let counter = document.querySelector('#test'); + removeDOMElement(counter); + function hindu_main() { + document.addEventListener('bpc_event', function (e) { + if (window) { + window.Adblock = false; + window.isNonSubcribed = false; + } + }) + } + insert_script(hindu_main); + document.dispatchEvent(new CustomEvent('bpc_event', {})); } else if (matchDomain("nytimes.com")) { @@ -1132,7 +1138,7 @@ else if (matchDomain("stocknews.com")) { blurmes[i].setAttribute('id', 'blurmenot' + i); } -else if (matchDomain(["nrz.de", "wp.de", "wr.de", "waz.de"])) { +else if (matchDomain(["nrz.de", "waz.de", "wp.de", "wr.de"])) { let obfuscated_elems = document.querySelectorAll('.obfuscated'); let parser = new DOMParser(); for (let obfuscated_elem of obfuscated_elems) { diff --git a/lp/manifest.json b/lp/manifest.json index 30b7751..e904810 100644 --- a/lp/manifest.json +++ b/lp/manifest.json @@ -271,7 +271,6 @@ "*://*.qiota.com/*", "*://*.tinypass.com/*", "*://*.tribdss.com/*", - "*://ajax.cloudflare.com/*", "*://*.ampproject.org/*", "*://*.bwbx.io/*", "*://*.cedsdigital.it/*", @@ -306,5 +305,5 @@ "webRequest", "webRequestBlocking" ], - "version": "1.8.8.5" + "version": "1.8.8.6" } diff --git a/manifest.json b/manifest.json index 06b1ebc..0b3188b 100644 --- a/manifest.json +++ b/manifest.json @@ -21,5 +21,5 @@ "page": "options.html" }, "permissions": [ "cookies", "", "storage", "webRequest", "webRequestBlocking"], - "version": "1.8.8.5" + "version": "1.8.8.6" }