From 8ee8ada8a74c50e45df13375638fb55788a6f542 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Thu, 3 Aug 2023 19:04:35 +0200 Subject: [PATCH] Add Autocar.co.uk --- README.md | 1 + changelog.txt | 1 + contentScript.js | 13 ++++++++++++- custom/manifest.json | 2 +- manifest.json | 3 ++- sites.js | 5 +++++ sites_updated.json | 9 ++++++++- 7 files changed, 30 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1a06ceb..9d60ee0 100644 --- a/README.md +++ b/README.md @@ -410,6 +410,7 @@ Grouped in options:\ [Follow the Money (ftm.eu)](https://www.ftm.eu) ##### United Kingdom/Ireland +[Autocar](https://www.autocar.co.uk) - [Belfast Telegraph](https://www.belfasttelegraph.co.uk) - [Business Post](https://www.businesspost.ie) - [Citywire](https://www.citywire.com) - diff --git a/changelog.txt b/changelog.txt index 84c1e93..ca21de9 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,6 +3,7 @@ Changelog Bypass Paywalls Clean - Firefox Updates (install signed xpi-file): https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/releases Post-release +Add Autocar.co.uk Add Crikey.com.au Fix EUobserver (css) Fix Grupo Vocento (limit amp-redirect) diff --git a/contentScript.js b/contentScript.js index c5cb5ca..39d6ef1 100644 --- a/contentScript.js +++ b/contentScript.js @@ -2520,7 +2520,18 @@ else } else if (window.location.hostname.match(/\.(ie|uk)$/) || matchDomain(['citywire.com', 'ft.com', 'scotsman.com', 'tes.com'])) {//united kingdom/ireland -if (matchDomain(['belfasttelegraph.co.uk', 'independent.ie'])) { +if (matchDomain('autocar.co.uk')) { + let url = window.location.href; + let paywall = document.querySelector('div.ms-block, div.register-block'); + if (paywall) { + removeDOMElement(paywall); + csDoneOnce = true; + let url_cache = 'https://webcache.googleusercontent.com/search?q=cache:' + url.split('?')[0]; + replaceDomElementExt(url_cache, true, false, 'div.content-wrapper'); + } +} + +else if (matchDomain(['belfasttelegraph.co.uk', 'independent.ie'])) { let flip_pay = document.querySelector('div#flip-pay[style]'); if (flip_pay && dompurify_loaded) { let content = document.querySelector('script[data-fragment-type="ArticleContent"]'); diff --git a/custom/manifest.json b/custom/manifest.json index e65b470..b9552de 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -51,5 +51,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.2.7.4" + "version": "3.2.7.5" } diff --git a/manifest.json b/manifest.json index a1e4725..6c813a1 100644 --- a/manifest.json +++ b/manifest.json @@ -84,6 +84,7 @@ "*://*.atlantico.fr/*", "*://*.augsburger-allgemeine.de/*", "*://*.auto-motor-und-sport.de/*", + "*://*.autocar.co.uk/*", "*://*.automobilwoche.de/*", "*://*.autonews.com/*", "*://*.autoplus.fr/*", @@ -772,5 +773,5 @@ "*://*.wyleex.com/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.2.7.4" + "version": "3.2.7.5" } diff --git a/sites.js b/sites.js index 8f1ff77..2a1bf0e 100644 --- a/sites.js +++ b/sites.js @@ -185,6 +185,11 @@ var defaultSites = { allow_cookies: 1, block_regex: /\.auto-motor-und-sport\.de\/thenewsbar\/static\/pw\.js/ }, + "Autocar.co.uk": { + domain: "autocar.co.uk", + allow_cookies: 1, + cs_dompurify: 1 + }, "Automobilwoche": { domain: "automobilwoche.de", allow_cookies: 1, diff --git a/sites_updated.json b/sites_updated.json index e3564cd..aa80231 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -25,7 +25,14 @@ "Auto Motor und Sport": { "domain": "auto-motor-und-sport.de", "allow_cookies": 1, - "block_regex": "\\.auto-motor-und-sport\\.de\\/thenewsbar\\/static\\/pw\\.js" + "block_regex": "\\.auto-motor-und-sport\\.de\\/thenewsbar\\/static\\/pw\\.js", + "new_site": 1 + }, + "Autocar.co.uk": { + "domain": "autocar.co.uk", + "allow_cookies": 1, + "ld_google_webcache": "div.ms-block,div.register-block|div.content-wrapper", + "new_site": 1 }, "Automobilwoche": { "domain": "automobilwoche.de",