mirror of
https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean.git
synced 2024-11-10 04:01:58 +01:00
Fix Times of India
This commit is contained in:
parent
0ead259eae
commit
08d1ad2809
6 changed files with 29 additions and 8 deletions
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -675,5 +675,5 @@
|
|||
"*://*.wsj.net/*",
|
||||
"*://webcache.googleusercontent.com/*"
|
||||
],
|
||||
"version": "2.6.9.3"
|
||||
"version": "2.6.9.4"
|
||||
}
|
||||
|
|
5
sites.js
5
sites.js
|
@ -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
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue