From 3758b47174a302209bb86b76c9a344e2808867b1 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sun, 14 Jun 2020 18:37:06 +0200 Subject: [PATCH] Add Republic.ru --- README.md | 2 ++ background.js | 3 ++- contentScript.js | 5 +++++ lp/manifest.json | 1 + sites.js | 1 + 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index df79527f..9883dc5a 100644 --- a/README.md +++ b/README.md @@ -207,6 +207,8 @@ Install add-on by downloading xpi-file. [Trouw](https://www.trouw.nl) - [Volkskrant](https://www.volkskrant.nl) - [Vrij Nederland](https://www.vn.nl) +##### Russia +[Republic.ru](https://republic.ru) ##### Spain [El Mundo](https://www.elmundo.es) - [El PaĆ­s](https://elpais.com) diff --git a/background.js b/background.js index 32f9b635..919c8123 100644 --- a/background.js +++ b/background.js @@ -123,6 +123,7 @@ const use_google_bot_default = [ 'miamiherald.com', 'ntnews.com.au', 'quora.com', +'republic.ru', 'seekingalpha.com', 'switzersuperreport.com.au', 'theathletic.co.uk', @@ -382,7 +383,7 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) { } // remove cookies Discover Magazine - if (matchUrlDomain('ctfassets.net', details.url) && matchUrlDomain('discovermagazine.com', header_referer)) { + if (matchUrlDomain('ctfassets.net', details.url) && matchUrlDomain('discovermagazine.com', header_referer) && isSiteEnabled({url: 'https://www.discovermagazine.com'})) { ext_api.cookies.getAll({domain: 'discovermagazine.com'}, function(cookies) { for (let cookie of cookies) { ext_api.cookies.remove({url: (cookie.secure ? "https://" : "http://") + cookie.domain + cookie.path, name: cookie.name}); diff --git a/contentScript.js b/contentScript.js index c7a46286..747945f4 100644 --- a/contentScript.js +++ b/contentScript.js @@ -679,6 +679,11 @@ else if (matchDomain('independent.ie')) { } } +else if (matchDomain('republic.ru')) { + let paywall = document.querySelector('.paywall-section'); + removeDOMElement(paywall); +} + // General Functions function removeDOMElement(...elements) { for (let element of elements) { diff --git a/lp/manifest.json b/lp/manifest.json index 0d205d9f..5a1f1151 100644 --- a/lp/manifest.json +++ b/lp/manifest.json @@ -169,6 +169,7 @@ "*://*.quora.com/*", "*://*.qz.com/*", "*://*.repubblica.it/*", + "*://*.republic.ru/*", "*://*.sacbee.com/*", "*://*.sandiegouniontribune.com/*", "*://*.science-et-vie.com/*", diff --git a/sites.js b/sites.js index 28075326..24b528d9 100644 --- a/sites.js +++ b/sites.js @@ -113,6 +113,7 @@ var defaultSites = "Pittsburgh Post Gazette": "post-gazette.com", "Quartz": "qz.com", "Quora": "quora.com", + "Republic.ru": "republic.ru", "San Diego Union Tribune": "sandiegouniontribune.com", "San Francisco Chronicle": "sfchronicle.com", "Science & Vie": "science-et-vie.com",