From 9e3ae5c371dca6810c92ffa7763bbc146b2a8fb0 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sun, 23 Oct 2022 18:11:32 +0200 Subject: [PATCH] Add The Scotsman --- README.md | 1 + changelog.txt | 1 + contentScript.js | 12 ++++++++++-- manifest.json | 3 ++- options/popup.html | 2 +- sites.js | 5 +++++ sites_updated.json | 10 ++++++++++ 7 files changed, 30 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f119662..c4b87d7 100644 --- a/README.md +++ b/README.md @@ -400,6 +400,7 @@ Grouped in options:\ [The Irish Times](https://www.irishtimes.com) - [The New European](https://www.theneweuropean.co.uk) - [The New Statesman](https://www.newstatesman.com) - +[The Scotsman](https://www.scotsman.com) - [The Spectator](https://www.spectator.co.uk) - [The Telegraph](https://www.telegraph.co.uk) - [The Times (link to archive.today)](https://www.thetimes.co.uk) - diff --git a/changelog.txt b/changelog.txt index caf1159..e1ecec3 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,6 +4,7 @@ Changelog Bypass Paywalls Clean - Firefox Post-release Add Humanite.fr Add Philonomist (text) +Add The Scotsman Remove Daily Nation (no paywall) Remove MediaNama (fix obsolete) Fix ABC.es (Sevilla) diff --git a/contentScript.js b/contentScript.js index eec1b65..0a9b986 100644 --- a/contentScript.js +++ b/contentScript.js @@ -1486,7 +1486,7 @@ else if (matchDomain('lesinrocks.com')) { } else if (matchDomain('lexpress.fr')) { - let ads = document.querySelectorAll('div.block_pub, div.bottom-bar-full, div.pub_content_display, div.ban-bottom'); + let ads = document.querySelectorAll('div[class^="block_pub"], div.bottom-bar-full, div.tead, div.ban-bottom'); removeDOMElement(...ads); } @@ -2103,7 +2103,7 @@ else if (matchDomain('vn.nl')) { else csDone = true; -} else if (window.location.hostname.match(/\.(ie|uk)$/)) {//united kingdom/ireland +} else if (window.location.hostname.match(/\.(ie|uk)$/) || matchDomain(['scotsman.com'])) {//united kingdom/ireland if (matchDomain(['belfasttelegraph.co.uk', 'independent.ie'])) { let flip_pay = document.querySelector('div#flip-pay[style]'); @@ -2144,6 +2144,14 @@ else if (matchDomain('prospectmagazine.co.uk')) { }, 1000); } +else if (matchDomain('scotsman.com')) { + let premium = document.querySelector('div.premium.no-entitlement'); + if (premium) + premium.classList.remove('no-entitlement'); + let ads = document.querySelectorAll('div[class^="MarkupAds__Container-"], div[class^="Dailymotion__Wrapper-"], div.OUTBRAIN'); + removeDOMElement(...ads); +} + else if (matchDomain('spectator.co.uk')) { if (window.location.pathname.startsWith('/article/')) { let body_par = document.querySelector('p[class^="ContentPageBodyParagraph"]'); diff --git a/manifest.json b/manifest.json index 4f740c2..81cb8df 100644 --- a/manifest.json +++ b/manifest.json @@ -521,6 +521,7 @@ "*://*.sciencesetavenir.fr/*", "*://*.scientificamerican.com/*", "*://*.scmp.com/*", + "*://*.scotsman.com/*", "*://*.sdbj.com/*", "*://*.seattletimes.com/*", "*://*.seekingalpha.com/*", @@ -720,5 +721,5 @@ "*://gcm.omerlocdn.com/*", "*://webcache.googleusercontent.com/*" ], - "version": "2.8.9.5" + "version": "2.8.9.6" } diff --git a/options/popup.html b/options/popup.html index 9a36165..4cdece3 100644 --- a/options/popup.html +++ b/options/popup.html @@ -18,7 +18,7 @@
Bypass Paywalls Clean   
Options | Custom | -GitLab | +Help | Twitter
Changelog | | diff --git a/sites.js b/sites.js index f1dd6b5..087583a 100644 --- a/sites.js +++ b/sites.js @@ -1901,6 +1901,11 @@ var defaultSites = { allow_cookies: 1, block_regex: /(\.seattletimes\.com\/wp-content\/.+\/st-(advertising|blocking)-bundle\.js|cdn\.ampproject\.org\/v\d\/amp-access-.+\.js)/ }, + "The Scotsman": { + domain: "scotsman.com", + allow_cookies: 1, + block_regex: /(\.tinypass\.com\/|cdn\.ampproject\.org\/v\d\/amp-access-.+\.js)/ + }, "The Spectator (UK)": { domain: "spectator.co.uk", block_regex: /\.tinypass\.com\// diff --git a/sites_updated.json b/sites_updated.json index d77f3a6..5e4f073 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -47,6 +47,16 @@ "allow_cookies": 1, "block_regex": "\\.qiota\\.com\\/" }, + "The Scotsman": { + "domain": "scotsman.com", + "allow_cookies": 1, + "block_regex": "(\\.tinypass\\.com\\/|cdn\\.ampproject\\.org\\/v\\d\\/amp-access-.+\\.js)", + "cs_code": [{ + "cond": "div.premium.no-entitlement", + "rm_class": "no-entitlement" + } + ] + }, "The Washington Post": { "domain": "washingtonpost.com", "allow_cookies": 1,