Fix Times of India (no amp)

master
magnolia1234 2022-06-27 08:10:12 +02:00
parent 208586522c
commit 3a541a890d
2 changed files with 4 additions and 0 deletions

View File

@ -3,6 +3,7 @@ Changelog Bypass Paywalls Clean - Chrome
Post-release
Add BQ Prime (former Bloomberg Quint)
Fix Times of India (no amp)
* v2.7.3.0 (2022-06-26)
Add Artforum

View File

@ -3701,6 +3701,7 @@ else if (matchDomain('timeshighereducation.com')) {
}
else if (matchDomain(timesofindia_domains)) {
let url = window.location.href;
let region_block = document.querySelector('div.plan-popup.active');
if (region_block) {
removeDOMElement(region_block);
@ -3734,6 +3735,8 @@ else if (matchDomain(timesofindia_domains)) {
} else {
let paywall = document.querySelector('div#story-blocker');
let amphtml = document.querySelector('link[rel="amphtml"]');
if (!amphtml)
amphtml = {href: url.replace('/timesofindia.indiatimes.com/', '/m.timesofindia.com/').replace('/articleshow/', '/amp_articleshow/')};
if (paywall && amphtml) {
removeDOMElement(paywall);
window.location.href = amphtml.href;