From eb663205b06891f356312b6eac4cf1f1ea6a12d9 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sat, 15 May 2021 08:23:26 +0200 Subject: [PATCH] Fix-update Barron's (option to disable Googlebot; http error 500) --- background.js | 4 +++- changelog.txt | 1 + contentScript.js | 2 ++ custom/manifest.json | 2 +- manifest.json | 2 +- sites.js | 1 + 6 files changed, 9 insertions(+), 3 deletions(-) diff --git a/background.js b/background.js index 997f12c..966ed7b 100755 --- a/background.js +++ b/background.js @@ -1070,7 +1070,9 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) { var useUserAgentMobile = false; var setReferer = false; -if (matchUrlDomain(change_headers, details.url) && (['main_frame', 'sub_frame', 'xmlhttprequest'].includes(details.type) || matchUrlDomain(['thetimes.co.uk'], details.url)) && !(matchUrlDomain(['wsj.com'], details.url) && enabledSites.includes('#options_disable_gb_wsj'))){ +if (matchUrlDomain(change_headers, details.url) && (['main_frame', 'sub_frame', 'xmlhttprequest'].includes(details.type) || matchUrlDomain(['thetimes.co.uk'], details.url)) && + !(matchUrlDomain(['barrons.com'], details.url) && enabledSites.includes('#options_disable_gb_barrons')) && + !(matchUrlDomain(['wsj.com'], details.url) && enabledSites.includes('#options_disable_gb_wsj'))) { // if referer exists, set it to google requestHeaders = requestHeaders.map(function (requestHeader) { if (requestHeader.name === 'Referer') { diff --git a/changelog.txt b/changelog.txt index a716153..3f5a250 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,6 +4,7 @@ Changelog Bypass Paywalls Clean - Chrome Post-release Add Las Provincias (Spain) Add Times of India +Fix-update Barron's (option to disable Googlebot; http error 500) Fix-update Crain's Chicago Business Fix-update Knack.be Fix-update LeScienze.it diff --git a/contentScript.js b/contentScript.js index 143d938..b292d99 100755 --- a/contentScript.js +++ b/contentScript.js @@ -1610,6 +1610,8 @@ else if (matchDomain('barrons.com')) { signin_link.text = 'Click'; } } + let barrons_ads = document.querySelectorAll('.barrons-body-ad-placement'); + removeDOMElement(...barrons_ads); } else { let wsj_ads = document.querySelectorAll('.wsj-ad'); removeDOMElement(...wsj_ads); diff --git a/custom/manifest.json b/custom/manifest.json index 4fd7ee9..e26a28a 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -30,5 +30,5 @@ "webRequestBlocking", "" ], - "version": "2.2.0.6" + "version": "2.2.0.7" } \ No newline at end of file diff --git a/manifest.json b/manifest.json index 7d82774..28d8023 100755 --- a/manifest.json +++ b/manifest.json @@ -503,5 +503,5 @@ "*://*.wallkit.net/*", "*://*.wsj.net/*" ], - "version": "2.2.0.6" + "version": "2.2.0.7" } \ No newline at end of file diff --git a/sites.js b/sites.js index e4901b6..99629bf 100755 --- a/sites.js +++ b/sites.js @@ -315,6 +315,7 @@ var defaultSites = "* BPC settings": "###", "Show options on update": "#options_on_update", "Restore opt-in for custom sites (on reload; Chrome-only)": "#options_restore_custom", + "Barron's - no Googlebot (http error 500)": "#options_disable_gb_barrons", "The Wall Street Journal - no Googlebot (http error 500)": "#options_disable_gb_wsj" }