From 10ea0a5f76e2d95e3c353aee524d0b1648d94021 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sun, 2 Jan 2022 19:21:05 +0100 Subject: [PATCH] Add Science (free articles only) --- README.md | 1 + changelog.txt | 1 + contentScript.js | 8 ++++++++ manifest.json | 3 ++- sites.js | 4 ++++ sites_updated.json | 12 ++++++++++++ 6 files changed, 28 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4a0e605..c7e3d52 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,7 @@ Grouped in options:\ [National Geographic USA](https://www.nationalgeographic.com) - [Nautilus](https://nautil.us) - [Precision Oncology News](https://www.precisiononcologynews.com) - +[Science](https://www.science.org)* - [Scientific American](https://www.scientificamerican.com)* - [Times Higher Education](https://www.timeshighereducation.com) - [Towards Data Science](https://www.towardsdatascience.com) - diff --git a/changelog.txt b/changelog.txt index 4fc4266..ae52961 100644 --- a/changelog.txt +++ b/changelog.txt @@ -5,6 +5,7 @@ Post-release Add Capital Gazette (local USA) Add Groupe Nice-Matin (France) Add Il Foglio (Italy) +Add Science (free articles only) Add The Independent (UK - archive.today for premium) Fix group Tribune Publishing Company (js) Fix The New Statesman (Evolok) diff --git a/contentScript.js b/contentScript.js index d098c87..6f6240b 100644 --- a/contentScript.js +++ b/contentScript.js @@ -2743,6 +2743,14 @@ else if (matchDomain('qz.com')) { } } +else if (matchDomain('science.org')) { + let paywall = document.querySelector('div.alert-read-limit'); + removeDOMElement(paywall); + let overlay = document.querySelector('body.alert-read-limit__overlay'); + if (overlay) + overlay.classList.remove('alert-read-limit__overlay'); +} + else if (matchDomain('scmp.com') && window.location.href.includes('/amp.')) { let div_hidden = document.querySelectorAll('div.article-body[amp-access][amp-access-hide]'); for (let elem of div_hidden) diff --git a/manifest.json b/manifest.json index 4e7f849..da2c999 100644 --- a/manifest.json +++ b/manifest.json @@ -441,6 +441,7 @@ "*://*.sacbee.com/*", "*://*.sandiegouniontribune.com/*", "*://*.science-et-vie.com/*", + "*://*.science.org/*", "*://*.sciencesetavenir.fr/*", "*://*.scientificamerican.com/*", "*://*.scmp.com/*", @@ -604,5 +605,5 @@ "*://*.wsj.net/*", "*://*.zephr.com/*" ], - "version": "2.4.9.5" + "version": "2.4.9.6" } diff --git a/sites.js b/sites.js index d97b333..5f0cb31 100644 --- a/sites.js +++ b/sites.js @@ -1288,6 +1288,10 @@ var defaultSites = { allow_cookies: 1, block_regex: /cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad|fx-flying-carpet)-.+\.js/ }, + "Science": { + domain: "science.org", + allow_cookies: 1 + }, "Science & Vie": { domain: "science-et-vie.com", block_regex: /\.qiota\.com\// diff --git a/sites_updated.json b/sites_updated.json index d4a6b55..abac974 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -38,6 +38,18 @@ "allow_cookies": 1, "block_regex": "\\.qiota\\.com\\/" }, + "Science": { + "domain": "science.org", + "allow_cookies": 1, + "cs_code": [{ + "cond": "div.alert-read-limit", + "rm_elem": 1 + }, { + "cond": "body.alert-read-limit__overlay", + "rm_attrib": "class" + } + ] + }, "The Diplomat": { "domain": "thediplomat.com", "block_regex": "\\/thediplomat\\.com\\/.+\\/js\\/angular-cookies\\.min\\.js",