From e4622c9f4978f1b4621b5cd3c69b6f6e615fd2ee Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Fri, 11 Aug 2023 07:56:16 +0200 Subject: [PATCH] Fix Times of India (css) --- changelog.txt | 1 + contentScript.js | 13 +++++++++---- custom/manifest.json | 2 +- manifest.json | 2 +- sites_updated.json | 16 ++++++++++++++++ 5 files changed, 28 insertions(+), 6 deletions(-) diff --git a/changelog.txt b/changelog.txt index a7b33ed1..7c8c13fb 100644 --- a/changelog.txt +++ b/changelog.txt @@ -8,6 +8,7 @@ Remove The Hollywood Reporter (no paywall) Fix Harvard Business Review (js) Fix Stylist.co.uk (css) Fix The Toronto Star (homepage) +Fix Times of India (css) * v3.2.8.0 (2023-08-06) Add America's Test Kitchen diff --git a/contentScript.js b/contentScript.js index db0e9288..c7c44e45 100644 --- a/contentScript.js +++ b/contentScript.js @@ -51,7 +51,7 @@ var usa_outside_mag_domains = ["backpacker.com", "betamtb.com", "betternutrition var usa_tribune_domains = ['baltimoresun.com', 'chicagotribune.com', 'courant.com', 'dailypress.com', 'mcall.com', 'nydailynews.com', 'orlandosentinel.com', 'pilotonline.com', 'sun-sentinel.com']; // clean local storage of sites (with an exemption for hold-list) -var arr_localstorage_hold = ['augsburger-allgemeine.de', 'barrons.com', 'business-standard.com', 'businessinsider.com', 'businessoffashion.com', 'businesspost.ie', 'challenges.fr', 'charliehebdo.fr', 'cmjornal.pt', 'corriere.it', 'corrieredellosport.it', 'cyclingtips.com', 'dvhn.nl', 'economictimes.com', 'eldiario.es', 'elespanol.com', 'elle.fr', 'elpais.com', 'elperiodico.com', 'enotes.com', 'estadao.com.br', 'forbes.com', 'fortune.com', 'freiepresse.de', 'gauchazh.clicrbs.com.br', 'globo.com', 'ilfoglio.it', 'inc42.com', 'indianexpress.com', 'ksta.de', 'kurier.at', 'lanouvellerepublique.fr', 'latimes.com', 'lc.nl', 'lesechos.fr', 'livemint.com', 'mid-day.com', 'mundodeportivo.com', 'nationalreview.com', 'nrc.nl', 'nw.de', 'nwzonline.de', 'nytimes.com', 'nzherald.co.nz', 'record.pt', 'ruhrnachrichten.de', 'rundschau-online.de', 'sandiegouniontribune.com', 'scmp.com', 'seekingalpha.com', 'telegraph.co.uk', 'tes.com', 'theatlantic.com', 'thebulletin.org', 'thecritic.co.uk', 'thetimes.co.uk', 'uol.com.br', 'wsj.com'].concat(be_roularta_domains, ca_gcm_domains, ca_torstar_domains, de_funke_medien_domains, de_lv_domains, de_vrm_domains, de_vrm_custom_domains, de_westfalen_medien_domains, es_epiberica_domains, es_epiberica_custom_domains, es_grupo_vocento_domains, es_unidad_domains, fr_groupe_ebra_domains, fr_groupe_la_depeche_domains, fr_groupe_nice_matin_domains, it_gedi_domains, it_quotidiano_domains, ca_gcm_domains, nl_dpg_media_domains, no_nhst_media_domains, timesofindia_domains, usa_hearst_comm_domains, usa_mcc_domains); +var arr_localstorage_hold = ['augsburger-allgemeine.de', 'barrons.com', 'business-standard.com', 'businessinsider.com', 'businessoffashion.com', 'businesspost.ie', 'challenges.fr', 'charliehebdo.fr', 'cmjornal.pt', 'corriere.it', 'corrieredellosport.it', 'cyclingtips.com', 'dvhn.nl', 'economictimes.com', 'eldiario.es', 'elespanol.com', 'elle.fr', 'elpais.com', 'elperiodico.com', 'enotes.com', 'estadao.com.br', 'forbes.com', 'fortune.com', 'freiepresse.de', 'gauchazh.clicrbs.com.br', 'globo.com', 'ilfoglio.it', 'inc42.com', 'indianexpress.com', 'indiatoday.in', 'ksta.de', 'kurier.at', 'lanouvellerepublique.fr', 'latimes.com', 'lc.nl', 'lesechos.fr', 'livemint.com', 'mid-day.com', 'mundodeportivo.com', 'nationalreview.com', 'nrc.nl', 'nw.de', 'nwzonline.de', 'nytimes.com', 'nzherald.co.nz', 'record.pt', 'ruhrnachrichten.de', 'rundschau-online.de', 'sandiegouniontribune.com', 'scmp.com', 'seekingalpha.com', 'telegraph.co.uk', 'tes.com', 'theatlantic.com', 'thebulletin.org', 'thecritic.co.uk', 'thetimes.co.uk', 'uol.com.br', 'wsj.com'].concat(be_roularta_domains, ca_gcm_domains, ca_torstar_domains, de_funke_medien_domains, de_lv_domains, de_vrm_domains, de_vrm_custom_domains, de_westfalen_medien_domains, es_epiberica_domains, es_epiberica_custom_domains, es_grupo_vocento_domains, es_unidad_domains, fr_groupe_ebra_domains, fr_groupe_la_depeche_domains, fr_groupe_nice_matin_domains, it_gedi_domains, it_quotidiano_domains, ca_gcm_domains, nl_dpg_media_domains, no_nhst_media_domains, timesofindia_domains, usa_hearst_comm_domains, usa_mcc_domains); if (!matchDomain(arr_localstorage_hold)) { window.localStorage.clear(); } @@ -1981,6 +1981,12 @@ else if (matchDomain(['iltirreno.it', 'lanuovasardegna.it']) || matchDomain(['ga else if (matchDomain(it_ilmessaggero_domains)) { if (window.location.pathname.toLowerCase().includes('/amp/')) { amp_unhide_subscr_section('amp-ad, amp-embed'); + } else { + let noscroll = document.querySelector('html[style]'); + if (noscroll) + noscroll.removeAttribute('style'); + let ads = document.querySelectorAll('div.adv_banner, div#outbrain'); + hideDOMElement(...ads); } } @@ -3826,8 +3832,7 @@ else if (matchDomain('indiatoday.in')) { } else { amp_unhide_access_hide('="granted"', '="NOT NOT granted"', 'amp-ad, amp-embed'); } - } else - csDoneOnce = true; + } } else if (matchDomain('infzm.com')) { @@ -4946,7 +4951,7 @@ else if (matchDomain(timesofindia_domains)) { overflow.removeAttribute('style'); } if (!window.location.pathname.includes('/amp_')) { - let paywall = document.querySelector('div#story-blocker'); + let paywall = document.querySelector('div[id^="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/')}; diff --git a/custom/manifest.json b/custom/manifest.json index fb60053c..1e5dbf2d 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -51,5 +51,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.2.8.3" + "version": "3.2.8.4" } diff --git a/manifest.json b/manifest.json index a774f7e5..58281797 100644 --- a/manifest.json +++ b/manifest.json @@ -779,5 +779,5 @@ "*://*.wyleex.com/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.2.8.3" + "version": "3.2.8.4" } diff --git a/sites_updated.json b/sites_updated.json index 3212e437..53a819c7 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -153,6 +153,22 @@ "ld_json": "div.bg-paywall-fade|div.duet--article--article-body-component-container", "new_site": 1 }, + "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[id^='story-blocker]" + } + ], + "upd_version": "3.2.8.4" + }, "TownNews sites (Blox CMS)": { "domain": "###_usa_townnews", "block_regex_general": "\\/shared-content\\/art\\/tncms\\/api\\/access\\.js",