From bacbe52913ff1d753d36f70a3564d9332b46eddb Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sun, 5 Jan 2020 13:02:44 +0100 Subject: [PATCH] Add The Athletic --- README.md | 1 + background.js | 13 ++++++++----- contentScript.js | 6 ++++++ manifest.json | 6 ++++-- options.js | 1 + 5 files changed, 20 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 556301b..965d833 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ [Telegraaf](https://telegraaf.nl)\ [The Advocate](https://www.theadvocate.com.au)\ [The Age](https://www.theage.com.au)\ +[The Athletic](https://theathletic.com)\ [The Atlantic](https://www.theatlantic.com)\ [The Australian](https://www.theaustralian.com.au)\ [The Australian Financial Review](https://www.afr.com)\ diff --git a/background.js b/background.js index 6cfa3ba..39d763b 100644 --- a/background.js +++ b/background.js @@ -64,6 +64,7 @@ var defaultSites = { 'Telegraaf': 'telegraaf.nl', 'The Advocate': 'theadvocate.com.au', 'The Age': 'theage.com.au', + 'The Athletic': 'theathletic.com', 'The Atlantic': 'theatlantic.com', 'The Australian': 'theaustralian.com.au', 'The Australian Financial Review': 'afr.com', @@ -139,6 +140,7 @@ const allow_cookies = [ 'telegraaf.nl', 'theadvocate.com.au', 'theage.com.au', +'theathletic.com', 'theatlantic.com', 'theaustralian.com.au', 'thediplomat.com', @@ -211,19 +213,20 @@ const remove_cookies_select_drop = { // Override User-Agent with Googlebot const use_google_bot = [ 'barrons.com', +'haaretz.co.il', +'haaretz.com', 'lemonde.fr', +'nknews.org', 'nytimes.com', +'prime.economictimes.indiatimes.com', 'quora.com', 'telegraph.co.uk', +'theathletic.com', 'theaustralian.com.au', +'themarker.com', 'themercury.com.au', 'thetimes.co.uk', 'wsj.com', -'haaretz.co.il', -'haaretz.com', -'themarker.com', -'nknews.org', -'prime.economictimes.indiatimes.com' ] function setDefaultOptions() { diff --git a/contentScript.js b/contentScript.js index f331fe8..8c73fed 100644 --- a/contentScript.js +++ b/contentScript.js @@ -222,6 +222,12 @@ if (window.location.href.indexOf("nrc.nl") !== -1) { paywall_overlay.classList.remove("has-paywall-overlay"); } +if (window.location.href.indexOf("theathletic.com") !== -1) { + const banner = document.querySelector('.border-bottom-cc'); + const subscribe = document.querySelector('.subscribe-ad-text'); + removeDOMElement(banner, subscribe); +} + function removeDOMElement(...elements) { for (let element of elements) { if (element) element.remove(); diff --git a/manifest.json b/manifest.json index d70f75f..202e6f1 100644 --- a/manifest.json +++ b/manifest.json @@ -24,7 +24,8 @@ "*://*.economist.com/*", "*://*.the-tls.co.uk/*", "*://*.leparisien.fr/*", - "*://*.nrc.nl/*" + "*://*.nrc.nl/*", + "*://*.theathletic.com/*" ], "js": ["contentScript.js"] } @@ -158,7 +159,8 @@ "*://*.inquirer.com/*", "*://*.indiatimes.com/*", "*://*.leparisien.fr/*", - "*://*.lesechos.fr/*" + "*://*.lesechos.fr/*", + "*://*.theathletic.com/*" ], "version": "1.6.3" } diff --git a/options.js b/options.js index 3a0e295..12c991b 100644 --- a/options.js +++ b/options.js @@ -62,6 +62,7 @@ var defaultSites = { 'Telegraaf': 'telegraaf.nl', 'The Advocate': 'theadvocate.com.au', 'The Age': 'theage.com.au', + 'The Athletic': 'theathletic.com', 'The Atlantic': 'theatlantic.com', 'The Australian': 'theaustralian.com.au', 'The Australian Financial Review (javascript disabled)': 'afr.com',