diff --git a/changelog.txt b/changelog.txt index 3fd1c9a..d50a51f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -6,6 +6,7 @@ Post-release Remove Bhaskar (fix obsolete) Fix Haaretz Group (Semrushbot) Fix The Diplomat (magazine) +Fix Times of India (epaper) * v3.4.9.0 (2023-12-31) Add Business Insider Nederland diff --git a/contentScript.js b/contentScript.js index def5a0f..204722c 100644 --- a/contentScript.js +++ b/contentScript.js @@ -34,7 +34,7 @@ var nl_dpg_adr_domains = ['ad.nl', 'bd.nl', 'bndestem.nl', 'destentor.nl', 'ed.n var nl_dpg_media_domains = ['demorgen.be', 'flair.nl', 'humo.be', 'libelle.nl', 'margriet.nl', 'parool.nl', 'trouw.nl', 'volkskrant.nl']; var no_nhst_media_domains = ['europower.no', 'fiskeribladet.no', 'intrafish.com', 'intrafish.no', 'rechargenews.com', 'tradewindsnews.com', 'upstreamonline.com']; var pe_grupo_elcomercio_domains = ['diariocorreo.pe', 'elcomercio.pe', 'gestion.pe']; -var timesofindia_domains = ['timesofindia.com', 'timesofindia.indiatimes.com']; +var timesofindia_domains = ['epaper.indiatimes.com', 'timesofindia.com', 'timesofindia.indiatimes.com']; var uk_incisive_media_domains = ['businessgreen.com', 'internationalinvestment.net', 'investmentweek.co.uk', 'professionaladviser.com', 'professionalpensions.com']; var uk_nat_world_domains = ['scotsman.com', 'yorkshirepost.co.uk']; var usa_adv_local_domains = ['al.com', 'cleveland.com', 'lehighvalleylive.com', 'masslive.com', 'mlive.com', 'nj.com', 'oregonlive.com', 'pennlive.com', 'silive.com', 'syracuse.com']; @@ -5390,27 +5390,56 @@ 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); - let overflow = document.querySelector('html[style]'); - if (overflow) - overflow.removeAttribute('style'); - } - if (!window.location.pathname.includes('/amp_')) { - amp_redirect('div[id^="story-blocker"]', '', url.replace('/timesofindia.indiatimes.com/', '/m.timesofindia.com/').replace('/articleshow/', '/amp_articleshow/')); + if (matchDomain('epaper.indiatimes.com')) { + let blocker = document.querySelector('section.epaper-blocker'); + removeDOMElement(blocker); + if (window.location.pathname.startsWith('/english-news-paper-today-toi-print-edition/')) { + let paywall = document.querySelector('section#blocker'); + if (paywall) { + let fq = document.querySelector('section#fq'); + removeDOMElement(paywall, fq); + let json_script = getArticleJsonScript(); + if (json_script) { + let json = JSON.parse(json_script.text); + if (json) { + let json_text = json.articleBody; + let content = document.querySelector('section[type="synopsis"]'); + if (json_text && content) { + let article_new = document.createElement('p'); + article_new.innerText = breakText(json_text); + content.innerHTML = ''; + let sheet = document.createElement('style'); + sheet.innerText = '[type="synopsis"]::after {background: none !important;}'; + document.body.appendChild(sheet); + content.appendChild(article_new); + } + } + } + } + } } else { - let amp_images = document.querySelectorAll('div.inline-image > div.inline-imgecontent > amp-img[src]'); - for (let amp_image of amp_images) { - amp_image.parentNode.removeAttribute('class'); - amp_image.parentNode.parentNode.removeAttribute('class'); - let elem = document.createElement('img'); - Object.assign(elem, { - src: amp_image.getAttribute('src'), - alt: amp_image.getAttribute('alt') - }); - amp_image.parentNode.replaceChild(elem, amp_image); + let url = window.location.href; + let region_block = document.querySelector('div.plan-popup.active'); + if (region_block) { + removeDOMElement(region_block); + let overflow = document.querySelector('html[style]'); + if (overflow) + overflow.removeAttribute('style'); + } + if (!window.location.pathname.includes('/amp_')) { + amp_redirect('div[id^="story-blocker"]', '', url.replace('/timesofindia.indiatimes.com/', '/m.timesofindia.com/').replace('/articleshow/', '/amp_articleshow/')); + } else { + let amp_images = document.querySelectorAll('div.inline-image > div.inline-imgecontent > amp-img[src]'); + for (let amp_image of amp_images) { + amp_image.parentNode.removeAttribute('class'); + amp_image.parentNode.parentNode.removeAttribute('class'); + let elem = document.createElement('img'); + Object.assign(elem, { + src: amp_image.getAttribute('src'), + alt: amp_image.getAttribute('alt') + }); + amp_image.parentNode.replaceChild(elem, amp_image); + } } } } diff --git a/custom/manifest.json b/custom/manifest.json index 508e7c8..292996c 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -51,5 +51,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.4.9.3" + "version": "3.4.9.4" } diff --git a/manifest.json b/manifest.json index 0ea4f6f..ef7d019 100644 --- a/manifest.json +++ b/manifest.json @@ -214,7 +214,6 @@ "*://*.eastwest.eu/*", "*://*.echo-online.de/*", "*://*.economictimes.com/*", - "*://*.economictimes.indiatimes.com/*", "*://*.economist.com/*", "*://*.ed.nl/*", "*://*.editorialedomani.it/*", @@ -334,6 +333,7 @@ "*://*.independent.co.uk/*", "*://*.independent.ie/*", "*://*.indianexpress.com/*", + "*://*.indiatimes.com/*", "*://*.indiatoday.in/*", "*://*.indystar.com/*", "*://*.inews.co.uk/*", @@ -705,7 +705,6 @@ "*://*.tijd.be/*", "*://*.timeshighereducation.com/*", "*://*.timesofindia.com/*", - "*://*.timesofindia.indiatimes.com/*", "*://*.timesunion.com/*", "*://*.tirebusiness.com/*", "*://*.tlz.de/*", @@ -826,5 +825,5 @@ "*://archive.vn/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.4.9.3" + "version": "3.4.9.4" } diff --git a/sites.js b/sites.js index 6052716..2192357 100644 --- a/sites.js +++ b/sites.js @@ -2533,14 +2533,15 @@ var defaultSites = { "Times of India": { domain: "###_timesofindia", group: [ + "epaper.indiatimes.com", "timesofindia.com", "timesofindia.indiatimes.com" ], allow_cookies: 1, - useragent: "googlebot", exception: [{ - domain: "timesofindia.indiatimes.com", - allow_cookies: 1 + domain: "timesofindia.com", + allow_cookies: 1, + useragent: "googlebot" } ] }, diff --git a/updates.json b/updates.json index 02b6c9d..2407319 100644 --- a/updates.json +++ b/updates.json @@ -2,8 +2,8 @@ "addons": { "magnolia@12.34": { "updates": [ - { "version": "3.4.8.0", - "update_link": "https://gitlab.com/magnolia1234/bpc-uploads/-/raw/master/bypass_paywalls_clean-3.4.8.0.xpi" } + { "version": "3.4.9.0", + "update_link": "https://gitlab.com/magnolia1234/bpc-uploads/-/raw/master/bypass_paywalls_clean-3.4.9.0.xpi" } ] } }