Fix TheTimes.co.uk (epaper)

merge-requests/3/head
magnolia1234 3 years ago
parent bb9ac25e76
commit b07383671b

@ -47,6 +47,7 @@ Visit the [Chrome repository](https://gitlab.com/magnolia1234/bypass-paywalls-ch
#### Notes
* This add-on works best alongside the adblocker [uBlock Origin](https://addons.mozilla.org/en-US/firefox/addon/ublock-origin).
* 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 add-on).
### List of supported websites

@ -7,7 +7,7 @@ var manifestData = ext_api.runtime.getManifest();
var ext_name = manifestData.name;
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 csDone = false;
var optin_setcookie = false;
@ -915,7 +915,7 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) {
var setReferer = false;
var googlebotEnabled = matchUrlDomain(use_google_bot, details.url) &&
!(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'));
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]||-)+)$/));

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

@ -1784,19 +1784,35 @@ else if (matchDomain(['theathletic.com', 'theathletic.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 paywall = document.querySelector('div#paywall-portal-article-footer');
if (paywall && !url.includes('?shareToken=')) {
removeDOMElement(paywall);
let article = document.querySelector('article[role="article"]');
if (article)
article.insertBefore(archiveLink(url), article.firstChild);
if (window.location.hostname !== 'epaper.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 paywall = document.querySelector('div#paywall-portal-article-footer');
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']))
@ -1845,7 +1861,7 @@ else if (matchDomain('elmercurio.com')) {
elem.removeAttribute('style');
let page_pdf_content = document.querySelector('div.page_pdf_content');
let close_html = document.querySelector('div.close_html');
removeDOMElement(page_pdf_content, close_html)
removeDOMElement(page_pdf_content, close_html);
}, 1000); // Delay (in milliseconds)
window.setTimeout(function () {
let cont_articlelight = document.querySelector('div.cont_articlelight');

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

@ -149,7 +149,7 @@ var defaultSites = {
"westernadvocate.com.au"
],
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": {
domain: "barrons.com",

Loading…
Cancel
Save