From c3d6c770560faa00ac6940e9aacae781b3297623 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Fri, 5 May 2023 16:30:17 +0200 Subject: [PATCH] Update custom (flex) sites (no fix group) --- background.js | 47 ++++++++++++++++++++++------------------ changelog.txt | 1 + contentScript.js | 2 +- custom/manifest.json | 2 +- custom/sites_custom.json | 7 ++++++ manifest.json | 2 +- 6 files changed, 37 insertions(+), 24 deletions(-) diff --git a/background.js b/background.js index 7fbd853..f0cce09 100644 --- a/background.js +++ b/background.js @@ -1303,12 +1303,9 @@ function clear_cookies() { } if (rules.ld_json) ld_json[custom_domain] = rules.ld_json; - custom_flex_domains.push(custom_domain); - if (!enabledSites.includes(custom_domain)) - enabledSites.push(custom_domain); - ext_api.tabs.reload({bypassCache: true}); if (rules.add_ext_link && rules.add_ext_link_type) add_ext_link[custom_domain] = {css: rules.add_ext_link, type: rules.add_ext_link_type}; + ext_api.tabs.reload({bypassCache: true}); } var chrome_scheme = 'light'; @@ -1325,25 +1322,33 @@ ext_api.runtime.onMessage.addListener(function (message, sender) { let group = message.data.group; if (group) { let nofix_groups = ['###_ch_tamedia', '###_fi_alma_talent', '###_it_citynews']; - if (enabledSites.concat(nofix_groups).includes(group) && !custom_flex_domains.includes(custom_domain)) { - let rules; - if (group === 'elmercurio.com') - rules = {block_regex: "(\\.{domain}\\/impresa\\/.+\\/assets\\/(vendor|\\d)\\.js|pram\\.pasedigital\\.cl\\/API\\/User\\/Status\\?)"}; + if (!custom_flex_domains.includes(custom_domain)) { + if (enabledSites.includes(group)) { + let rules; + if (group === 'elmercurio.com') + rules = {block_regex: "(\\.{domain}\\/impresa\\/.+\\/assets\\/(vendor|\\d)\\.js|pram\\.pasedigital\\.cl\\/API\\/User\\/Status\\?)"}; + else { + rules = Object.values(defaultSites).filter(x => x.domain === group)[0]; + if (rules) { + if (group === '###_de_madsack') + if (!set_var_sites.includes(custom_domain)) + set_var_sites.push(custom_domain); + } else + rules = Object.values(customSites).filter(x => x.domain === group)[0]; + } + if (rules) { + custom_flex_domains.push(custom_domain); + if (!enabledSites.includes(custom_domain)) + enabledSites.push(custom_domain); + customAddRules(custom_domain, rules); + } + } else if (disabledSites.includes(group)) + custom_flex_not_domains.push(custom_domain); else if (nofix_groups.includes(group)) nofix_sites.push(custom_domain); - else { - rules = Object.values(defaultSites).filter(x => x.domain === group)[0]; - if (group === '###_de_madsack') - if (!set_var_sites.includes(custom_domain)) - set_var_sites.push(custom_domain); - } - if (rules) { - customAddRules(custom_domain, rules); - } - } else if (disabledSites.includes(group)) - custom_flex_not_domains.push(custom_domain); - } else - custom_flex_not_domains.push(custom_domain); + } + } else + custom_flex_not_domains.push(custom_domain); } if (message.request === 'site_switch') { site_switch(); diff --git a/changelog.txt b/changelog.txt index 96485ae..5699c13 100644 --- a/changelog.txt +++ b/changelog.txt @@ -9,6 +9,7 @@ Remove Puck.news (fix obsolete) Fix Adweek (premium) Fix Modern Healthcare (sponsored) Fix Sportico (amp) +Update custom (flex) sites (no fix group) * v3.1.6.0 (2023-04-30) Remove Zeit.de (fix obsolete) diff --git a/contentScript.js b/contentScript.js index d40cbca..23dff79 100644 --- a/contentScript.js +++ b/contentScript.js @@ -909,7 +909,7 @@ else if (matchDomain('tagesanzeiger.ch')) { let paywall = document.querySelector('div#piano-premium > div'); if (paywall) { removeDOMElement(paywall.parentNode); - let article = document.querySelector('article p'); + let article = document.querySelector('article p > span'); if (article) article.firstChild.before(archiveLink(url)); } diff --git a/custom/manifest.json b/custom/manifest.json index 07bc040..12235c3 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -51,5 +51,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.1.6.5" + "version": "3.1.6.6" } diff --git a/custom/sites_custom.json b/custom/sites_custom.json index 1f983ca..c903480 100644 --- a/custom/sites_custom.json +++ b/custom/sites_custom.json @@ -575,6 +575,13 @@ "amp_redirect": "div#story-notification", "domain": "swarajyamag.com" }, + "Tamedia.ch": { + "add_ext_link": "div#piano-premium>div|article p>span", + "add_ext_link_type": "google_search_tool", + "allow_cookies": 1, + "block_regex": "\\.piano\\.io\\/xbuilder\\/experience\\/execute", + "domain": "###_ch_tamedia" + }, "The-past.com": { "domain": "the-past.com" }, diff --git a/manifest.json b/manifest.json index ae8a6d5..34ff376 100644 --- a/manifest.json +++ b/manifest.json @@ -755,5 +755,5 @@ "*://html.onlineviewer.net/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.1.6.5" + "version": "3.1.6.6" }