Fix TheTimes.co.uk (epaper & archive)
This commit is contained in:
parent
2e31de5d0b
commit
e9b58a440b
@ -885,21 +885,21 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) {
|
||||
let allow_ext_source = medium_custom_domain;
|
||||
let bpc_amp_site = false;
|
||||
|
||||
if (isSiteEnabled({url: header_referer})) {
|
||||
let inkl_site = (matchUrlDomain('cdn.jsdelivr.net', details.url) && matchUrlDomain('inkl.com', header_referer));
|
||||
let cl_elmerc_site = (matchUrlDomain('emol.cl', details.url) && matchUrlDomain('elmercurio.com', header_referer));
|
||||
let es_elesp_site = (matchUrlDomain('eestatic.com', details.url) && matchUrlDomain('elespanol.com', header_referer));
|
||||
let it_repubblica_site = (matchUrlDomain(['repstatic.it'], details.url) && matchUrlDomain(it_repubblica_domains, header_referer));
|
||||
let usa_law360_site = (matchUrlDomain('law360news.com', details.url) && matchUrlDomain('law360.com', header_referer));
|
||||
let usa_mw_site = (matchUrlDomain('wsj.net', details.url) && matchUrlDomain('marketwatch.com', header_referer));
|
||||
let usa_natgeo_site = (matchUrlDomain('natgeofe.com', details.url) && matchUrlDomain('nationalgeographic.com', header_referer));
|
||||
let usa_today_site = (matchUrlDomain('gannett-cdn.com', details.url) && matchUrlDomain(['usatoday.com'], header_referer));
|
||||
allow_ext_source = allow_ext_source || inkl_site || cl_elmerc_site || es_elesp_site || it_repubblica_site || usa_law360_site || usa_mw_site || usa_natgeo_site || usa_today_site;
|
||||
|
||||
if (isSiteEnabled({url: header_referer}) && ['script', 'image'].includes(details.type)) {
|
||||
bpc_amp_site = matchUrlDomain('cdn.ampproject.org', details.url);
|
||||
allow_ext_source = allow_ext_source || bpc_amp_site ||
|
||||
(matchUrlDomain('elespanol.com', header_referer) && matchUrlDomain('eestatic.com', details.url)) ||
|
||||
(matchUrlDomain('elmercurio.com', header_referer) && matchUrlDomain('emol.cl', details.url)) ||
|
||||
(matchUrlDomain('epaper.thetimes.co.uk', header_referer) && matchUrlDomain(['prcdn.co'], details.url)) ||
|
||||
(matchUrlDomain('inkl.com', header_referer) && matchUrlDomain('cdn.jsdelivr.net', details.url)) ||
|
||||
(matchUrlDomain('law360.com', header_referer) && matchUrlDomain('law360news.com', details.url)) ||
|
||||
(matchUrlDomain('marketwatch.com', header_referer) && matchUrlDomain('wsj.net', details.url)) ||
|
||||
(matchUrlDomain('nationalgeographic.com', header_referer) && matchUrlDomain('natgeofe.com', details.url)) ||
|
||||
(matchUrlDomain('usatoday.com', header_referer) && matchUrlDomain('gannett-cdn.com', details.url)) ||
|
||||
(matchUrlDomain(it_repubblica_domains, header_referer) && matchUrlDomain(['repstatic.it'], details.url));
|
||||
}
|
||||
|
||||
if (!isSiteEnabled(details) && !allow_ext_source && !bpc_amp_site) {
|
||||
if (!isSiteEnabled(details) && !allow_ext_source) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@ Changelog Bypass Paywalls Clean - Chrome
|
||||
|
||||
Post-release
|
||||
Add Groupe Sud Ouest (France)
|
||||
Fix TheTimes.co.uk (epaper & archive)
|
||||
Update block general paywall script (limit NewsMemory)
|
||||
|
||||
* v2.5.5.0 (2022-02-06)
|
||||
|
@ -1804,18 +1804,37 @@ else if (matchDomain('thetimes.co.uk')) {
|
||||
removeDOMElement(paywall_page);
|
||||
} else {
|
||||
if (url.includes('/textview')) {
|
||||
function thetimes_link(node) {
|
||||
let article = node.closest('article[aid]');
|
||||
let article_locks = document.querySelectorAll('article[aid] > div > div > a.readmore.dis[href="javascript:void(0)"]');
|
||||
for (let elem of article_locks) {
|
||||
let article = elem.closest('article[aid]');
|
||||
if (article)
|
||||
node.href = 'article/' + article.getAttribute('aid');
|
||||
elem.href = 'article/' + article.getAttribute('aid');
|
||||
}
|
||||
let headers = document.querySelectorAll('article[aid] > header > hgroup > h1');
|
||||
for (let elem of headers) {
|
||||
let article = elem.closest('article[aid]');
|
||||
if (article && !elem.innerHTML.includes('</a>')) {
|
||||
let new_link = document.createElement('a');
|
||||
new_link.href = 'article/' + article.getAttribute('aid');
|
||||
new_link.innerText = elem.innerText;
|
||||
elem.innerText = '';
|
||||
elem.appendChild(new_link);
|
||||
}
|
||||
}
|
||||
let continued_links = document.querySelectorAll('a.continued[href="javascript:void(0)"]');
|
||||
for (let elem of continued_links) {
|
||||
let pagenr = parseInt(elem.innerText.replace('Continued from ', ''));
|
||||
if (pagenr)
|
||||
elem.href = url.replace(/\/page\/(\d)+\/textview/, '/page/' + pagenr + '/textview');
|
||||
}
|
||||
let bottom_links = document.querySelectorAll('article > a[id^="athumb_"][article-id][href="javascript:void(0)"]');
|
||||
for (let elem of bottom_links)
|
||||
elem.href = 'article/' + elem.getAttribute('article-id');
|
||||
} else {
|
||||
let pages = document.querySelectorAll('div.page-left, div.page-right');
|
||||
for (let page of pages)
|
||||
page.style.height = 'auto';
|
||||
}
|
||||
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';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3425,16 +3444,21 @@ function replaceDomElementExt(url, proxy, base64, selector, text_fail = '', sele
|
||||
}
|
||||
|
||||
function archiveLink(url) {
|
||||
let archive_url = 'https://archive.today?run=1&url=' + url.split('?')[0];
|
||||
let text_fail_div = document.createElement('div');
|
||||
text_fail_div.id = 'bpc_archive';
|
||||
text_fail_div.setAttribute('style', 'margin: 20px; font-weight: bold; color:red;');
|
||||
text_fail_div.appendChild(document.createTextNode('BPC > Full article text:\r\n'));
|
||||
let a_link = document.createElement('a');
|
||||
a_link.innerText = archive_url;
|
||||
a_link.href = archive_url;
|
||||
a_link.target = '_blank';
|
||||
text_fail_div.appendChild(a_link);
|
||||
function add_links(domains) {
|
||||
for (let domain of domains) {
|
||||
let a_link = document.createElement('a');
|
||||
a_link.innerText = domain;
|
||||
a_link.href = 'https://' + domain + '?run=1&url=' + url.split('?')[0];
|
||||
a_link.target = '_blank';
|
||||
text_fail_div.appendChild(document.createTextNode(' | '));
|
||||
text_fail_div.appendChild(a_link);
|
||||
}
|
||||
}
|
||||
add_links(['archive.today', 'archive.is']);
|
||||
return text_fail_div;
|
||||
}
|
||||
|
||||
|
@ -39,5 +39,5 @@
|
||||
"webRequestBlocking",
|
||||
"<all_urls>"
|
||||
],
|
||||
"version": "2.5.5.2"
|
||||
"version": "2.5.5.3"
|
||||
}
|
||||
|
@ -595,11 +595,12 @@
|
||||
"*://*.natgeofe.com/*",
|
||||
"*://*.nyt.com/*",
|
||||
"*://*.pasedigital.cl/*",
|
||||
"*://*.prcdn.co/*",
|
||||
"*://*.repstatic.it/*",
|
||||
"*://*.rndtech.de/*",
|
||||
"*://*.sanoma-sndp.fi/*",
|
||||
"*://*.wallkit.net/*",
|
||||
"*://*.wsj.net/*"
|
||||
],
|
||||
"version": "2.5.5.2"
|
||||
"version": "2.5.5.3"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user