Fix TheTimes.co.uk (epaper)

This commit is contained in:
magnolia1234 2022-02-03 20:16:51 +01:00
parent 8b0ad0ca6c
commit 1b05bc7090
7 changed files with 36 additions and 18 deletions

View File

@ -64,6 +64,7 @@ Visit the [Firefox repository](https://gitlab.com/magnolia1234/bypass-paywalls-f
* Do not delete extension's folder from your computer/smartphone or Bypass Paywalls Clean (in developer mode) will disappear at restart. * Do not delete extension's folder from your computer/smartphone or Bypass Paywalls Clean (in developer mode) will disappear at restart.
* In Chrome/Opera/Brave to disable the developer mode extensions popup use the extensions toolbar menu (by default enabled in Chrome 87+ or (if available) enable (experimental) chrome flag: chrome://flags/#extensions-toolbar-menu) * In Chrome/Opera/Brave to disable the developer mode extensions popup use the extensions toolbar menu (by default enabled in Chrome 87+ or (if available) enable (experimental) chrome flag: chrome://flags/#extensions-toolbar-menu)
* You will be logged out for most of the sites you have checked. * You will be logged out for most of the sites you have checked.
* Some sites need to redirect to an amp-page (add an exception in your amp2html extension).
### Update ### Update
For crx-installation: check for updates (in chrome://extensions).\ For crx-installation: check for updates (in chrome://extensions).\

View File

@ -7,7 +7,7 @@ var manifestData = ext_api.runtime.getManifest();
var ext_name = manifestData.name; var ext_name = manifestData.name;
var ext_version = manifestData.version; var ext_version = manifestData.version;
const cs_limit_except = ['elespanol.com', 'faz.net', 'inkl.com', 'nation.africa', 'nationalgeographic.com']; const cs_limit_except = ['elespanol.com', 'faz.net', 'inkl.com', 'nation.africa', 'nationalgeographic.com', 'thetimes.co.uk'];
var currentTabUrl = ''; var currentTabUrl = '';
var csDone = false; var csDone = false;
var optin_setcookie = false; var optin_setcookie = false;
@ -915,7 +915,7 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) {
var setReferer = false; var setReferer = false;
var googlebotEnabled = matchUrlDomain(use_google_bot, details.url) && var googlebotEnabled = matchUrlDomain(use_google_bot, details.url) &&
!(matchUrlDomain('barrons.com', details.url) && enabledSites.includes('#options_disable_gb_barrons')) && !(matchUrlDomain('barrons.com', details.url) && enabledSites.includes('#options_disable_gb_barrons')) &&
!(matchUrlDomain('thetimes.co.uk', details.url) && !details.url.match(/\/epaper\.thetimes\.co\.uk\//)) && !(matchUrlDomain('thetimes.co.uk', details.url) && !details.url.match(/\/epaper\.thetimes\.co\.uk\/article\//)) &&
!(matchUrlDomain('wsj.com', details.url) && enabledSites.includes('#options_disable_gb_wsj')); !(matchUrlDomain('wsj.com', details.url) && enabledSites.includes('#options_disable_gb_wsj'));
var bingbotEnabled = matchUrlDomain(use_bing_bot, details.url) && var bingbotEnabled = matchUrlDomain(use_bing_bot, details.url) &&
!(matchUrlDomain('stratfor.com', details.url) && details.url.match(/(\/(\d){4}-([a-z]||-)+-forecast(-([a-z]|-)+)?|-forecast-(\d){4}-([a-z]|[0-9]||-)+)$/)); !(matchUrlDomain('stratfor.com', details.url) && details.url.match(/(\/(\d){4}-([a-z]||-)+-forecast(-([a-z]|-)+)?|-forecast-(\d){4}-([a-z]|[0-9]||-)+)$/));

View File

@ -6,6 +6,7 @@ Remove The Logic (fix obsolete)
Fix Australia News Corp (video-still) Fix Australia News Corp (video-still)
Fix La Tercera (js) Fix La Tercera (js)
Fix MIT Technology Review (TinyPass) Fix MIT Technology Review (TinyPass)
Fix TheTimes.co.uk (epaper)
Fix Times Literary Supplement (set referer Google) Fix Times Literary Supplement (set referer Google)
* v2.5.4.0 (2022-01-30) * v2.5.4.0 (2022-01-30)
@ -510,7 +511,7 @@ Fix Cors Anywhere (link to allow access)
Fix Il Secolo XIX (amp) Fix Il Secolo XIX (amp)
Fix Medium custom domains (meter) Fix Medium custom domains (meter)
Fix Statista (premium) Fix Statista (premium)
Fix The Times (puzzles) Fix TheTimes.co.uk (puzzles)
Update popup (not closing on switch/clear cookies) Update popup (not closing on switch/clear cookies)
* v2.0.7.0 (2021-02-07) * v2.0.7.0 (2021-02-07)

View File

@ -1784,19 +1784,35 @@ else if (matchDomain(['theathletic.com', 'theathletic.co.uk'])) {
} }
else if (matchDomain('thetimes.co.uk')) { else if (matchDomain('thetimes.co.uk')) {
let block = document.querySelector('.subscription-block');
let adverts = document.querySelectorAll('#ad-article-inline, #sticky-ad-header, div[class*="InlineAdWrapper"], div[class*="NativeAd"], div.responsiveweb-sc-1exejum-0');
removeDOMElement(block, ...adverts);
let url = window.location.href; let url = window.location.href;
let paywall = document.querySelector('div#paywall-portal-article-footer'); if (window.location.hostname !== 'epaper.thetimes.co.uk') {
if (paywall && !url.includes('?shareToken=')) { let block = document.querySelector('.subscription-block');
removeDOMElement(paywall); let adverts = document.querySelectorAll('#ad-article-inline, #sticky-ad-header, div[class*="InlineAdWrapper"], div[class*="NativeAd"], div.responsiveweb-sc-1exejum-0');
let article = document.querySelector('article[role="article"]'); removeDOMElement(block, ...adverts);
if (article) let paywall = document.querySelector('div#paywall-portal-article-footer');
article.insertBefore(archiveLink(url), article.firstChild); if (paywall && !url.includes('?shareToken=')) {
removeDOMElement(paywall);
let article = document.querySelector('article[role="article"]');
if (article)
article.insertBefore(archiveLink(url), article.firstChild);
}
let paywall_page = document.querySelector('div#paywall-portal-page-footer');
removeDOMElement(paywall_page);
} else {
if (url.includes('/textview')) {
function thetimes_link(node) {
let article = node.closest('article[aid]');
if (article)
node.href = 'article/' + article.getAttribute('aid');
}
waitDOMElement('article[aid] > div > div > a.readmore.dis[href="javascript:void(0)"]', 'A', thetimes_link, true);
csDoneOnce = true;
} else {
let pages = document.querySelectorAll('div.page-left, div.page-right');
for (let page of pages)
page.style.height = 'auto';
}
} }
let paywall_page = document.querySelector('div#paywall-portal-page-footer');
removeDOMElement(paywall_page);
} }
else if (!matchDomain(['belfasttelegraph.co.uk', 'independent.ie'])) else if (!matchDomain(['belfasttelegraph.co.uk', 'independent.ie']))
@ -1845,7 +1861,7 @@ else if (matchDomain('elmercurio.com')) {
elem.removeAttribute('style'); elem.removeAttribute('style');
let page_pdf_content = document.querySelector('div.page_pdf_content'); let page_pdf_content = document.querySelector('div.page_pdf_content');
let close_html = document.querySelector('div.close_html'); let close_html = document.querySelector('div.close_html');
removeDOMElement(page_pdf_content, close_html) removeDOMElement(page_pdf_content, close_html);
}, 1000); // Delay (in milliseconds) }, 1000); // Delay (in milliseconds)
window.setTimeout(function () { window.setTimeout(function () {
let cont_articlelight = document.querySelector('div.cont_articlelight'); let cont_articlelight = document.querySelector('div.cont_articlelight');

View File

@ -39,5 +39,5 @@
"webRequestBlocking", "webRequestBlocking",
"<all_urls>" "<all_urls>"
], ],
"version": "2.5.4.2" "version": "2.5.4.3"
} }

View File

@ -600,5 +600,5 @@
"*://*.wallkit.net/*", "*://*.wallkit.net/*",
"*://*.wsj.net/*" "*://*.wsj.net/*"
], ],
"version": "2.5.4.2" "version": "2.5.4.3"
} }

View File

@ -149,7 +149,7 @@ var defaultSites = {
"westernadvocate.com.au" "westernadvocate.com.au"
], ],
allow_cookies: 1, allow_cookies: 1,
block_regex: /cdn-au\.piano\.io\/api\/tinypass.+\.js/ block_regex: /(cdn-au\.piano\.io\/api\/tinypass.+\.js|\.com\.au\/static\/.+\/js\/vendor\.js)/
}, },
"Barron's": { "Barron's": {
domain: "barrons.com", domain: "barrons.com",