From 5c1b3673d59422621ad9a326ab7d29f7a60c6480 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Mon, 6 Nov 2023 19:48:00 +0100 Subject: [PATCH] Add Haymarket Media Group Update custom sites (delete default sites) --- README.md | 2 ++ changelog.txt | 9 ++++++--- contentScript_once.js | 4 ++++ custom/manifest.json | 2 +- custom/sites_custom.json | 6 ++++++ manifest.json | 2 +- options/options_custom.html | 3 ++- options/options_custom.js | 25 +++++++++++++++++++++++- options/popup.js | 1 + sites.js | 14 +++++++++++++ sites_updated.json | 39 ------------------------------------- 11 files changed, 61 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index 4fad254..70aeb20 100644 --- a/README.md +++ b/README.md @@ -466,6 +466,8 @@ Grouped in options:\ [UnHerd](https://unherd.com) Grouped in options:\ +*[Haymarket Media Group](https://haymarket.com/brands)* sites (opt-in to custom sites)\ +*[Haymarket Medical Network](https://www.haymarketmedicalnetwork.com)* sites (opt-in to custom sites)\ *[Incisive Media](https://www.incisivemedia.com/brands)* sites (opt-in to custom sites)\ *National World Publishing* sites like (opt-in to custom sites for unlisted)\ [The Scotsman](https://www.scotsman.com) - diff --git a/changelog.txt b/changelog.txt index c660213..f23bb2a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,6 +3,9 @@ Changelog Bypass Paywalls Clean - Firefox Updates (install signed xpi-file): https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/releases Post-release +Add Haymarket Media Group (opt-in to custom sites) +Add Haymarket Medical Network (opt-in to custom sites) +Update custom sites (delete default sites) * v3.4.1.0 (2023-11-05) Add Jane's Defence Weekly @@ -308,7 +311,7 @@ Fix Mediahuis Noord (json) Fix Quora (AI bot crash) Fix TheTimes.co.uk (overlay) Fix TownNews sites (encrypted) -Update popup (Google Search Tool) +Update popup (link to Google Search Tool) * v3.1.9.0 (2023-05-21) Remove (custom) Substack (fix obsolete) @@ -372,7 +375,7 @@ Fix Berlingske.dk Fix NYTimes (Googlebot) Fix Tagesspiegel.de (background; link to Google Search Tool) Update block general paywall script (Ippen.space) -Update popup (12ft.io) +Update popup (link to 12ft.io) * v3.1.3.0 (2023-04-10) Add Haas Mediengruppe (opt-in to custom sites) @@ -538,7 +541,7 @@ Fix National Review (no amp) Fix The Athletic (error) Fix Vogue Business Update custom sites (default block cookies) -Update popup (Google Search Tool) +Update popup (link to Google Search Tool) * v3.0.0.0 (2023-01-08) Add Deutscher Fachverlag Mediengruppe (opt-in to custom sites) diff --git a/contentScript_once.js b/contentScript_once.js index 8ba5d85..8794e5a 100644 --- a/contentScript_once.js +++ b/contentScript_once.js @@ -41,6 +41,10 @@ window.setTimeout(function () { group = '###_substack_custom';// no fix else if (document.querySelector('script[src*="/wp-content/themes/pmgnews/scripts/promedia.js"], form[action^="https://go.promedia.nl/"]')) group = '###_nl_promedia'; + else if (hostname.match(/\.com$/) && document.querySelector('span#hmn-logo > a[href="https://www.haymarketmedicalnetwork.com/about"], footer a[href="https://www.haymarketmediaus.com/haymarket-media-inc-privacy-policy/"]')) + group = '###_uk_haymarket_medical'; + else if (matchDomain(['asianinvestor.net', 'campaignindia.in', 'taspo.de']) || (hostname.match(/\.co(m|\.uk)$/) && document.querySelector('footer a[href^="http://www.haymarket.com"]'))) + group = '###_uk_haymarket'; else if (matchDomain(['epochtimes-romania.com']) || hostname.match(/\.epochtimes\.(cz|de|fr|jp)/)) group = '###_usa_epochtimes'; else if (hostname.match(/\.(com|net)\.au$/) && !matchDomain(['insideretail.com.au'])) { diff --git a/custom/manifest.json b/custom/manifest.json index 68f665d..d8a5548 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -51,5 +51,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.4.1.0" + "version": "3.4.1.1" } diff --git a/custom/sites_custom.json b/custom/sites_custom.json index 1a1a17f..f88f4fe 100644 --- a/custom/sites_custom.json +++ b/custom/sites_custom.json @@ -232,6 +232,12 @@ "amp_redirect": "div#memberplusModal", "domain": "farmersjournal.ie" }, + "Finance.si": { + "add_ext_link": "div[id^='hardlock_']|div#article_main", + "add_ext_link_type": "google_search_tool", + "allow_cookies": 1, + "domain": "finance.si" + }, "Finansavisen.no": { "allow_cookies": 1, "domain": "finansavisen.no", diff --git a/manifest.json b/manifest.json index df0aad8..4b439fa 100644 --- a/manifest.json +++ b/manifest.json @@ -808,5 +808,5 @@ "*://*.wyleex.com/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.4.1.0" + "version": "3.4.1.1" } diff --git a/options/options_custom.html b/options/options_custom.html index 214efa1..0bbc25c 100644 --- a/options/options_custom.html +++ b/options/options_custom.html @@ -12,7 +12,7 @@ To add a new site, enter an unique title/domain (without www.).
Select options below (see GitLab help); for examples import from GitLab.
Custom sites (new) are enabled automatically in (cookies will be blocked by default unless you enable allow_cookies).
- If you want to use custom sites (for unisted sites) enable it in + If you want to use custom sites (for unlisted sites) enable it in Custom sites enabled:
You can also just request host permissions for the custom sites & post-release added sites (below).
If host permission is missing the icon badge will contain a 'C' (or '+C' if you can import the custom site from GitLab; when no fix X). @@ -36,6 +36,7 @@ +
permissions granted (for all in custom list + updated): diff --git a/options/options_custom.js b/options/options_custom.js index 6616ece..e039e11 100644 --- a/options/options_custom.js +++ b/options/options_custom.js @@ -63,7 +63,6 @@ function sort_options() { var sites_custom_sorted = sortJson(sites_custom); textareaEl.value = JSON.stringify(sites_custom_sorted); } - } // Export custom sites to file @@ -225,6 +224,29 @@ function delete_options() { }); } +// Delete custom (& default) sites from ext_api.storage +function delete_default_options() { + ext_api.storage.local.get({ + sites_custom: {} + }, function (items) { + sites_custom = filterObject(items.sites_custom, function (val, key) { + return !defaultSites_domains.includes(val.domain); + }); + + ext_api.storage.local.set({ + sites_custom: sites_custom + }, function () { + // Update status to let user know custom & default sites were deleted. + var status_delete = document.getElementById('status_delete'); + status_delete.textContent = 'Default sites deleted.'; + setTimeout(function () { + //status.textContent = ''; + renderOptions(); + }, 800); + }); + }); +} + // Edit custom site (copy to add) function edit_options() { var selectEl = document.querySelector('#custom_sites select'); @@ -474,6 +496,7 @@ document.getElementById('importInput').addEventListener("change", import_options document.getElementById('import_gitlab').addEventListener('click', import_gitlab_options); document.getElementById('add').addEventListener('click', add_options); document.getElementById('delete').addEventListener('click', delete_options); +document.getElementById('delete_default').addEventListener('click', delete_default_options); document.getElementById('edit').addEventListener('click', edit_options); if (custom_switch) { document.getElementById('perm_request').addEventListener('click', request_permissions); diff --git a/options/popup.js b/options/popup.js index bb347cc..4913f8d 100644 --- a/options/popup.js +++ b/options/popup.js @@ -101,6 +101,7 @@ function showArchiveLinks() { elem.innerText = key; if (!(matchDomain(['1ft.io', 'clearthis.page', 'google.com', 'googleusercontent.com'], hostname) || hostname.match(/^archive\.\w{2}$/))) { elem.href = archive_array[key]; + elem.title = elem.href; elem.target = '_blank'; elem_div.appendChild(elem); archive_id.appendChild(elem_div); diff --git a/sites.js b/sites.js index 720823c..fb1d89a 100644 --- a/sites.js +++ b/sites.js @@ -1023,6 +1023,18 @@ var defaultSites = { block_regex: /cdn\.cxense\.com\//, remove_cookies_select_drop: ["xbc"] }, + "Haymarket Media Group (opt-in to custom sites)": { + domain: "###_uk_haymarket", + group: [], + useragent: "googlebot" + }, + "Haymarket Medical Network (opt-in to custom sites)": { + domain: "###_uk_haymarket_medical", + group: [], + allow_cookies: 1, + remove_cookies: 1, + cs_code: [{"cond":"div#modal-register-popup, div.gating-banner", "rm_elem":1}, {"cond":"div[data-gated]", "rm_attrib":"data-gated"}] + }, "Hearst Communications (newspapers)": { domain: "###_usa_hearst_comm", group: [ @@ -2829,6 +2841,8 @@ var custom_flex_not = { "###_de_madsack": ["madsack.de", "madsack-medien-campus.de"], "###_wp_leaky_paywall": ["dominionpost.com", "heisenbergreport.com", "thewirechina.com"], "###_uk_axate.io": ["thecricketer.com", "thinkofx.net"], + "###_uk_haymarket": ["gpbusiness.co.uk", "scmagazineuk.com", "thecorporatetreasurer.com"], + "###_uk_haymarket_medical": ["mycme.com"], "###_usa_hearst_comm": ["sfgate.com"], "###_usa_mcc": ["mcclatchy.com"], "###_usa_townnews": ["bloxdigital.com", "townnews.com"], diff --git a/sites_updated.json b/sites_updated.json index 0db9180..36719c9 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -17,27 +17,6 @@ "domain": "apollo-magazine.com", "upd_version": "3.3.9.3" }, - "Australia News Corp (when blocked disable Googlebot in BPC-settings)": { - "domain": "###_au_news_corp", - "group": [ - "adelaidenow.com.au", - "cairnspost.com.au", - "couriermail.com.au", - "dailytelegraph.com.au", - "geelongadvertiser.com.au", - "goldcoastbulletin.com.au", - "heraldsun.com.au", - "ntnews.com.au", - "theaustralian.com.au", - "thechronicle.com.au", - "themercury.com.au", - "townsvillebulletin.com.au", - "weeklytimesnow.com.au" - ], - "allow_cookies": 1, - "block_regex": "cdn\\.ampproject\\.org\\/v\\d\\/amp-subscriptions-.+\\.js", - "upd_version": "3.3.9.5" - }, "Bloomberg": { "domain": "bloomberg.com", "allow_cookies": 1, @@ -116,18 +95,6 @@ "add_ext_link_type": "archive.is", "upd_version": "3.4.0.4" }, - "Le Journal de Montréal": { - "domain": "journaldemontreal.com", - "allow_cookies": 1, - "block_js_inline": "\\.journalde.+\\.com\\/", - "upd_version": "3.3.8.5" - }, - "Le Journal de Québec": { - "domain": "journaldequebec.com", - "allow_cookies": 1, - "block_js_inline": "\\.journalde.+\\.com\\/", - "upd_version": "3.3.8.5" - }, "Le Monde (link to archive.is)": { "domain": "lemonde.fr", "allow_cookies": 1, @@ -151,12 +118,6 @@ "cs_code": "[{\"cond\":\"p.sz-article-body__paragraph--reduced\", \"rm_class\":\"sz-article-body__paragraph--reduced\"}]", "upd_version": "3.4.0.5" }, - "The Baffler": { - "domain": "thebaffler.com", - "allow_cookies": 1, - "block_regex": "\\/blink\\.net\\/.+\\/blink-sdk\\.js", - "upd_version": "3.3.8.3" - }, "The Economist": { "domain": "economist.com", "allow_cookies": 1,