From 5d86262d666b94cf7e3192fdcb015dbc5e58cb62 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Mon, 20 Nov 2023 12:41:38 +0100 Subject: [PATCH] Update popup (fix toggle for custom flex sites) --- background.js | 5 ++++- changelog.txt | 1 + contentScript.js | 2 +- custom/manifest.json | 2 +- manifest.json | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/background.js b/background.js index 0a803fc..d54943a 100644 --- a/background.js +++ b/background.js @@ -1411,7 +1411,10 @@ ext_api.runtime.onMessage.addListener(function (message, sender) { if (group) { let nofix_groups = ['###_ch_tamedia', '###_fi_alma_talent', '###_it_citynews', '###_nl_vmnmedia', '###_substack_custom', '###_uk_delinian']; if (!custom_flex_domains.includes(custom_domain)) { - custom_flex[group] = custom_flex[group] ? custom_flex[group].push(custom_domain) : [custom_domain]; + if (custom_flex[group]) + custom_flex[group].push(custom_domain); + else + custom_flex[group] = [custom_domain]; custom_flex_domains.push(custom_domain); if (enabledSites.includes(group)) { if (!enabledSites.includes(custom_domain)) diff --git a/changelog.txt b/changelog.txt index a252630..2302a86 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 +Update popup (fix toggle for custom flex sites) * v3.4.3.0 (2023-11-19) Add Doorbraak.be diff --git a/contentScript.js b/contentScript.js index 464a994..5a11d06 100644 --- a/contentScript.js +++ b/contentScript.js @@ -2500,9 +2500,9 @@ else if (matchDomain(['lc.nl', 'dvhn.nl']) || document.querySelector('head > lin let paywall = document.querySelector('div.signupPlus, div.pw-wrapper'); if (paywall && dompurify_loaded) { let intro = document.querySelector('div.startPayWall'); - removeDOMElement(paywall, intro); let html = document.documentElement.outerHTML; if (html.includes('window.__NUXT__=')) { + removeDOMElement(paywall, intro); try { let json = html.split('window.__NUXT__=')[1].split('')[0].trim(); let url_nuxt = json.includes(',canonical:"') ? json.split(',canonical:"')[1].match(/\d+\.(html|ece)/)[0] : false; diff --git a/custom/manifest.json b/custom/manifest.json index b19c75b..a79badf 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -51,5 +51,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.4.3.0" + "version": "3.4.3.1" } diff --git a/manifest.json b/manifest.json index ff1f0b9..536a3e3 100644 --- a/manifest.json +++ b/manifest.json @@ -815,5 +815,5 @@ "*://*.wyleex.com/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.4.3.0" + "version": "3.4.3.1" }