diff --git a/background.js b/background.js index 77d1e58..6d38cfa 100755 --- a/background.js +++ b/background.js @@ -585,7 +585,7 @@ var block_js = ["*://cdn.tinypass.com/*", "*://*.piano.io/*", "*://*.poool.fr/*" function disableJavascriptOnListedSites() { ext_api.webRequest.onBeforeRequest.addListener(function (details) { let header_referer = details.originUrl ? details.originUrl : details.initiator; - if (!isSiteEnabled(details) || matchUrlDomain(excludedSites, header_referer)) { + if (!isSiteEnabled(details) || matchUrlDomain(excludedSites.concat(['asia.nikkei.com']), header_referer)) { return; } return { @@ -1068,6 +1068,8 @@ function remove_cookies_fn(domainVar, exclusions = false) { storeId = store.id; } storeId = storeId.toString(); + if (domainVar === 'asia.nikkei.com') + domainVar = 'nikkei.com'; var cookie_get_options = { domain: domainVar }; diff --git a/changelog.txt b/changelog.txt index dacc29c..d3edbf8 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ Changelog Bypass Paywalls Clean - Chrome Post-release +Fix Nikkei Asian Review (cookies) * v2.4.3.0 (2021-11-07) Add Harvard Business Review China diff --git a/contentScript.js b/contentScript.js index 8fe6b17..54c0068 100755 --- a/contentScript.js +++ b/contentScript.js @@ -1439,8 +1439,8 @@ else if (matchDomain('spectator.co.uk')) { } else if (matchDomain('telegraph.co.uk')) { - let url = window.location.href; - if (new URL(url).pathname.endsWith('/amp/')) { + let url = window.location.href.split('?')[0]; + if (url.endsWith('/amp/')) { let paywall = document.querySelector('.premium-paywall'); if (paywall) { let truncated_content = document.querySelector('.truncated-content'); @@ -1449,6 +1449,11 @@ else if (matchDomain('telegraph.co.uk')) { if (subscr_section) subscr_section.removeAttribute('amp-access-hide'); } + let amp_ads = document.querySelectorAll('amp-ad, amp-embed'); + removeDOMElement(...amp_ads); + } else { + let ads = document.querySelectorAll('.advert, .commercial-unit'); + removeDOMElement(...ads); } } @@ -1613,7 +1618,7 @@ else if (matchDomain('americanaffairsjournal.org')) { } else if (matchDomain('asia.nikkei.com')) { - let popup = document.querySelector('.pw-widget--popup'); + let popup = document.querySelector('#pianoj_ribbon'); removeDOMElement(popup); } @@ -2257,8 +2262,9 @@ else if (matchDomain('newstatesman.com')) { } else if (matchDomain('newrepublic.com')) { - let pw_opups = document.querySelector('div#pwPopups'); - removeDOMElement(pw_opups); + let pw_popups = document.querySelector('div#pwPopups'); + let ads = document.querySelectorAll('.ad-unit, .ad-container'); + removeDOMElement(pw_popups, ...ads); } else if (matchDomain('newyorker.com') && window.location.href.split('?')[0].match(/\.com\/.+\//) ) { diff --git a/custom/manifest.json b/custom/manifest.json index 1c777dc..1d297c0 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -39,5 +39,5 @@ "webRequestBlocking", "" ], - "version": "2.4.3.0" + "version": "2.4.3.1" } \ No newline at end of file diff --git a/manifest.json b/manifest.json index 1ba2724..6bce392 100755 --- a/manifest.json +++ b/manifest.json @@ -546,5 +546,5 @@ "*://*.wallkit.net/*", "*://*.wsj.net/*" ], - "version": "2.4.3.0" + "version": "2.4.3.1" } \ No newline at end of file diff --git a/sites.js b/sites.js index 803c62c..d5466b8 100755 --- a/sites.js +++ b/sites.js @@ -1032,7 +1032,8 @@ var defaultSites = { referer: "facebook" }, "Nikkei Asian Review": { - domain: "asia.nikkei.com" + domain: "asia.nikkei.com", + remove_cookies_select_drop: ["xbc"] }, "NK News (free articles only)": { domain: "nknews.org",