From 0d5a4f5fe53dc07a356eda3d273019314385e37c Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Wed, 16 Mar 2022 18:48:35 +0100 Subject: [PATCH] Add Mid-Day (India) --- README.md | 1 + changelog.txt | 1 + contentScript.js | 19 ++++++++++++++++++- custom/manifest.json | 2 +- manifest.json | 3 ++- sites.js | 5 +++++ sites_updated.json | 9 +++++++++ 7 files changed, 37 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2c7146c..34e3829 100755 --- a/README.md +++ b/README.md @@ -681,6 +681,7 @@ Grouped in options:\ [Live Law](https://www.livelaw.in) - [LiveMint](https://www.livemint.com) - [MediaNama](https://www.medianama.com) - +[Mid-Day](https://www.mid-day.com) - [The Economic Times (ET Prime)](https://economictimes.indiatimes.com) - [The Hindu](https://www.thehindu.com) - [The Hindu BusinessLine](https://www.thehindubusinessline.com) - diff --git a/changelog.txt b/changelog.txt index 513f554..d93af62 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ Changelog Bypass Paywalls Clean - Chrome Post-release +Add Mid-Day (India) Fix Algemeen Dagblad (regional; refresh) Fix Folha de S. Paulo Fix Funke Mediengruppe (opt-in to custom sites for unlisted) diff --git a/contentScript.js b/contentScript.js index fe74c84..b5c5192 100755 --- a/contentScript.js +++ b/contentScript.js @@ -33,7 +33,7 @@ var usa_outside_mag_domains = ["backpacker.com", "betamtb.com", "cleaneatingmag. 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 = ['abc.es', 'allgaeuer-zeitung.de', 'augsburger-allgemeine.de', 'barrons.com', 'businessoffashion.com', 'challenges.fr', 'charliehebdo.fr', 'cmjornal.pt', 'corriere.it', 'eldiario.es', 'elespanol.com', 'elle.fr', 'elpais.com', 'elperiodico.com', 'estadao.com.br', 'forbes.com', 'fortune.com', 'freiepresse.de', 'ilfoglio.it', 'inc42.com', 'kurier.at', 'lanouvellerepublique.fr', 'lesechos.fr', 'nknews.org', 'nytimes.com', 'scmp.com', 'seekingalpha.com', 'telegraph.co.uk', 'thehindu.com', 'thetimes.co.uk', 'wsj.com'].concat(de_funke_media_domains, es_epiberica_domains, es_grupo_vocento_domains, es_unidad_domains, fr_groupe_ebra_domains, fr_groupe_la_depeche_domains, fr_groupe_nice_matin_domains, it_quotidiano_domains, no_nhst_media_domains, usa_hearst_comm_domains); +var arr_localstorage_hold = ['abc.es', 'allgaeuer-zeitung.de', 'augsburger-allgemeine.de', 'barrons.com', 'businessoffashion.com', 'challenges.fr', 'charliehebdo.fr', 'cmjornal.pt', 'corriere.it', 'eldiario.es', 'elespanol.com', 'elle.fr', 'elpais.com', 'elperiodico.com', 'estadao.com.br', 'forbes.com', 'fortune.com', 'freiepresse.de', 'ilfoglio.it', 'inc42.com', 'kurier.at', 'lanouvellerepublique.fr', 'lesechos.fr', 'mid-day.com', 'nknews.org', 'nytimes.com', 'scmp.com', 'seekingalpha.com', 'telegraph.co.uk', 'thehindu.com', 'thetimes.co.uk', 'wsj.com'].concat(de_funke_media_domains, es_epiberica_domains, es_grupo_vocento_domains, es_unidad_domains, fr_groupe_ebra_domains, fr_groupe_la_depeche_domains, fr_groupe_nice_matin_domains, it_quotidiano_domains, no_nhst_media_domains, usa_hearst_comm_domains); if (!matchDomain(arr_localstorage_hold)) { window.localStorage.clear(); } @@ -2829,6 +2829,23 @@ else if (matchDomain('medianama.com')) { csDoneOnce = true; } +else if (matchDomain('mid-day.com')) { + if (window.location.pathname.startsWith('/amp/')) { + amp_unhide_access_hide('="granted"', '="NOT granted"', 'amp-ad, amp-embed, [class*="BannerAd"]'); + } else { + let paywall = document.querySelector('div#widget-_csc'); + let amphtml = document.querySelector('link[rel="amphtml"]'); + if (paywall && amphtml) { + removeDOMElement(paywall); + window.location.href = amphtml.href; + } else { + let read_more = document.querySelector('#read-more-my'); + if (read_more) + read_more.click(); + } + } +} + else if (matchDomain('nation.africa')) { let datawall_content = document.querySelector('.datawall-content'); if (datawall_content) diff --git a/custom/manifest.json b/custom/manifest.json index f9d316c..a3743bc 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -40,5 +40,5 @@ "webRequestBlocking", "" ], - "version": "2.6.0.2" + "version": "2.6.0.3" } diff --git a/manifest.json b/manifest.json index 127eb6b..e7e1c52 100755 --- a/manifest.json +++ b/manifest.json @@ -360,6 +360,7 @@ "*://*.mercurynews.com/*", "*://*.mexiconewsdaily.com/*", "*://*.miamiherald.com/*", + "*://*.mid-day.com/*", "*://*.midi-olympique.fr/*", "*://*.midilibre.fr/*", "*://*.mikrobitti.fi/*", @@ -625,5 +626,5 @@ "*://*.wallkit.net/*", "*://*.wsj.net/*" ], - "version": "2.6.0.2" + "version": "2.6.0.3" } diff --git a/sites.js b/sites.js index 17f12d8..07616e5 100755 --- a/sites.js +++ b/sites.js @@ -1100,6 +1100,11 @@ var defaultSites = { allow_cookies: 1, block_regex: /\.mexiconewsdaily\.com\/c\/assets\/pigeon\.js/ }, + "Mid-Day": { + domain: "mid-day.com", + allow_cookies: 1, + block_regex: /cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad)-.+\.js/ + }, "MIT Sloan Management Review": { domain: "sloanreview.mit.edu", block_regex: /(\.tinypass\.com\/|\/sloanreview\.mit\.edu\/.+\/welcome-ad\.js)/, diff --git a/sites_updated.json b/sites_updated.json index 2938f7f..b4f362e 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -82,6 +82,15 @@ }, "amp_unhide": 1 }, + "Mid-Day": { + "domain": "mid-day.com", + "allow_cookies": 1, + "block_regex": "cdn\\.ampproject\\.org\\/v\\d\\/amp-(access|(sticky-)?ad)-.+\\.js", + "amp_redirect": { + "paywall": "#widget-_csc" + }, + "amp_unhide": 1 + }, "RugbyPass": { "domain": "rugbypass.com", "allow_cookies": 1,