Fix Times of India

This commit is contained in:
magnolia1234 2022-05-20 16:31:40 +02:00
parent 0ead259eae
commit 08d1ad2809
6 changed files with 29 additions and 8 deletions

View file

@ -676,7 +676,7 @@ function disableJavascriptOnListedSites() {
&& ((enabledSites.includes('###_wp_evolok') && details.url.includes('/wp-content/evolok/ev-widgets/ev-widgets.min.js'))
|| (enabledSites.includes('###_wp_pico') && details.url.includes('/wp-content/plugins/pico/includes/js/read-more.js'))
|| (enabledSites.includes('###_wp_pigeon') && details.url.includes('/c/assets/pigeon.js')))))
|| matchUrlDomain(excludedSites.concat(['asia.nikkei.com', 'cambridge.org', 'japantimes.co.jp']), header_referer)) {
|| matchUrlDomain(excludedSites.concat(disabledSites, ['asia.nikkei.com', 'cambridge.org', 'japantimes.co.jp']), header_referer)) {
return;
}
return {

View file

@ -5,6 +5,7 @@ Post-release
Add Mallorca Zeitung
Add The Lawyer's Daily (Canada)
Fix The Globe and Mail (revert to old fix)
Fix Times of India
* v2.6.9.0 (2022-05-15)
Add The Star Malaysia

View file

@ -3547,11 +3547,12 @@ else if (matchDomain(timesofindia_domains)) {
let paywall = document.querySelector('div.paywall');
if (paywall && dompurify_loaded) {
let contentblocker = document.querySelector('div#contentblocker');
removeDOMElement(contentblocker);
let bottom_banner = document.querySelector('#bottom_banner');
removeDOMElement(contentblocker, bottom_banner);
let preview = document.querySelector('div.article-txt');
if (preview) {
let parser = new DOMParser();
let doc = parser.parseFromString('<div>' + DOMPurify.sanitize(paywall.innerHTML, {ADD_TAGS: ['amp-img']}) + '</div>', 'text/html');
let doc = parser.parseFromString('<div style="margin: 0px 50px;">' + DOMPurify.sanitize(paywall.innerHTML, {ADD_TAGS: ['amp-img']}) + '</div>', 'text/html');
let article = doc.querySelector('div');
preview.parentNode.replaceChild(article, preview);
preview.classList.remove('prime-bottom-blur');
@ -3565,6 +3566,13 @@ else if (matchDomain(timesofindia_domains)) {
img_new.parentElement.classList.remove('inline-imgecontent');
img_new.parentElement.style = 'text-align: center;';
}
} else {
let paywall = document.querySelector('div#story-blocker');
let amphtml = document.querySelector('link[rel="amphtml"]');
if (paywall && amphtml) {
removeDOMElement(paywall);
window.location.href = amphtml.href;
}
}
}

View file

@ -675,5 +675,5 @@
"*://*.wsj.net/*",
"*://webcache.googleusercontent.com/*"
],
"version": "2.6.9.3"
"version": "2.6.9.4"
}

View file

@ -1823,12 +1823,9 @@ var defaultSites = {
],
allow_cookies: 1,
useragent: "googlebot",
block_regex: /\.timesofindia\.com\/jsrender\.cms/,
exception: [{
domain: "timesofindia.indiatimes.com",
allow_cookies: 1,
useragent: "googlebot",
block_regex: /timesofindia\.indiatimes\.com\/jsrender\/version-1\.cms/
allow_cookies: 1
}
]
},

View file

@ -23,6 +23,21 @@
"domain": "thestar.com.my",
"block_regex": "(cdn\\.cxense\\.com\\/|\\.piano\\.io\\/)"
},
"Times of India": {
"domain": "###_timesofindia",
"group": [
"timesofindia.com",
"timesofindia.indiatimes.com"
],
"allow_cookies": 1,
"useragent": "googlebot",
"exception": [{
"domain": "timesofindia.indiatimes.com",
"allow_cookies": 1,
"amp_redirect": "div#story-blocker"
}
]
},
"UnHerd": {
"domain": "unherd.com",
"allow_cookies": 1,