From e2326d0e9e0d650c234cc63ef9f05b7a6296cf15 Mon Sep 17 00:00:00 2001 From: FlorianButz Date: Sun, 5 Apr 2026 20:34:53 +0200 Subject: [PATCH 1/7] fix: Only set display none on zap after dissolve --- src/zen/boosts/ZenZapDissolve.sys.mjs | 11 ++++++++++- src/zen/boosts/ZenZapOverlayChild.sys.mjs | 16 ++++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/zen/boosts/ZenZapDissolve.sys.mjs b/src/zen/boosts/ZenZapDissolve.sys.mjs index 0bebcc352..25a2dd26d 100644 --- a/src/zen/boosts/ZenZapDissolve.sys.mjs +++ b/src/zen/boosts/ZenZapDissolve.sys.mjs @@ -154,6 +154,8 @@ void main() { #hasTriggered = false; #rafId = null; + #onComplete = null; + /** * @param {Document} document Webpage document */ @@ -482,12 +484,14 @@ void main() { * * @param {Element} element The element to dissolve */ - dissolve(element) { + dissolve(element, onComplete) { if (!this.#initialized || this.#hasTriggered || !element) { return; } this.#hasTriggered = true; + this.#onComplete = onComplete; + const rect = element.getBoundingClientRect(); if (rect.width === 0 || rect.height === 0) { console.warn("[ZapDissolve]: element has zero size. Skipping dissolve"); @@ -581,6 +585,11 @@ void main() { this.window.cancelAnimationFrame(this.#rafId); this.#rafId = null; } + + if(this.#onComplete){ + this.#onComplete(); + this.#onComplete = null; + } } /** diff --git a/src/zen/boosts/ZenZapOverlayChild.sys.mjs b/src/zen/boosts/ZenZapOverlayChild.sys.mjs index 279266700..dc9ea7bec 100644 --- a/src/zen/boosts/ZenZapOverlayChild.sys.mjs +++ b/src/zen/boosts/ZenZapOverlayChild.sys.mjs @@ -192,13 +192,21 @@ export class ZapOverlay { counter++; this.#getNextDissolveEffect().then(dissolve => { - dissolve.dissolve(element); + dissolve.dissolve(element, () => { + this.zenBoostsChild.addZapSelector(cssPath); + this.onZapUpdate(); + + this.window.requestAnimationFrame(() => { + element.style.visibility = 'initial'; + }); + }); + element.style.visibility = 'hidden'; }); }); + } else { + this.zenBoostsChild.addZapSelector(cssPath); + this.onZapUpdate(); } - - this.zenBoostsChild.addZapSelector(cssPath); - this.onZapUpdate(); } /** From 3e677ab95651eafd39e1addcd9669fa76ec73a29 Mon Sep 17 00:00:00 2001 From: FlorianButz Date: Sun, 12 Apr 2026 14:34:45 +0200 Subject: [PATCH 2/7] chore: Fix zap dissolve positioning --- src/zen/boosts/ZenZapDissolve.sys.mjs | 4 ++-- src/zen/boosts/zen-zap.css | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/zen/boosts/ZenZapDissolve.sys.mjs b/src/zen/boosts/ZenZapDissolve.sys.mjs index 860aff172..76402463c 100644 --- a/src/zen/boosts/ZenZapDissolve.sys.mjs +++ b/src/zen/boosts/ZenZapDissolve.sys.mjs @@ -509,8 +509,8 @@ void main() { ctx.drawWindow( this.window, - rect.left, - rect.top, + rect.left + this.window.scrollX, + rect.top + this.window.scrollY, rect.width, rect.height, "rgba(0,0,0,0)" diff --git a/src/zen/boosts/zen-zap.css b/src/zen/boosts/zen-zap.css index 6c65934d1..d1e2ae940 100644 --- a/src/zen/boosts/zen-zap.css +++ b/src/zen/boosts/zen-zap.css @@ -148,7 +148,7 @@ } #zen-zap-dissolve-canvas { - position: absolute !important; + position: fixed !important; width: 100% !important; height: 100% !important; left: 0 !important; From bc36696150b56a640fcb96ec3972f1824dd5d2ba Mon Sep 17 00:00:00 2001 From: FlorianButz Date: Sun, 12 Apr 2026 15:07:39 +0200 Subject: [PATCH 3/7] chore: Fix broken zap selector application --- src/zen/boosts/ZenBoostStyles.sys.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zen/boosts/ZenBoostStyles.sys.mjs b/src/zen/boosts/ZenBoostStyles.sys.mjs index 72d70a66d..a4936c25b 100644 --- a/src/zen/boosts/ZenBoostStyles.sys.mjs +++ b/src/zen/boosts/ZenBoostStyles.sys.mjs @@ -68,7 +68,7 @@ export class nsZenBoostStyles { let zapBlocks = ""; if (boostData.zapSelectors) { for (const selector of boostData.zapSelectors) { - zapBlocks += `html > body ${selector}:not([zen-zap-unhide]){ display: none !important; }\n`; + zapBlocks += `${selector}:not([zen-zap-unhide]){ display: none !important; }\n`; } if (zapBlocks != "") { From 26573572766225a4ffdae8790e458adfd76b9a04 Mon Sep 17 00:00:00 2001 From: FlorianButz Date: Sun, 12 Apr 2026 16:57:25 +0200 Subject: [PATCH 4/7] chore: Visual changes for accesibility --- src/zen/boosts/zen-boosts.css | 4 ++-- src/zen/boosts/zen-selector.css | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/zen/boosts/zen-boosts.css b/src/zen/boosts/zen-boosts.css index 5a6bdfc28..805822042 100644 --- a/src/zen/boosts/zen-boosts.css +++ b/src/zen/boosts/zen-boosts.css @@ -534,11 +534,11 @@ body { } .zen-boost-font-button-active { - background-color: #5b5b5c22 !important; + background-color: #5454572f !important; } .zen-boost-font-button-active:hover { - background-color: #5b5b5c32 !important; + background-color: #5b5b5c28 !important; } @property --mod-button-c1 { diff --git a/src/zen/boosts/zen-selector.css b/src/zen/boosts/zen-selector.css index fad947b4e..ee3131bc3 100644 --- a/src/zen/boosts/zen-selector.css +++ b/src/zen/boosts/zen-selector.css @@ -182,7 +182,7 @@ #selector-element-preview-text { font-family: Arial, Helvetica, sans-serif; font-size: 9pt; - color: #797b7f; + color: rgb(76, 78, 80); } #hover-div { From 7d904f0a39a0bbe30d1a152671f362765a877792 Mon Sep 17 00:00:00 2001 From: FlorianButz Date: Sun, 12 Apr 2026 19:11:05 +0200 Subject: [PATCH 5/7] chore: Change zap button behavior --- src/zen/boosts/ZenBoostsEditor.mjs | 6 +++++- src/zen/boosts/actors/ZenBoostsChild.sys.mjs | 3 +++ src/zen/boosts/zen-boosts.css | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/zen/boosts/ZenBoostsEditor.mjs b/src/zen/boosts/ZenBoostsEditor.mjs index d24152d24..ffc794918 100644 --- a/src/zen/boosts/ZenBoostsEditor.mjs +++ b/src/zen/boosts/ZenBoostsEditor.mjs @@ -461,9 +461,12 @@ ${cssSelector} { const actor = linkedBrowser.browsingContext.currentWindowGlobal.getActor("ZenBoosts"); const zapButton = this.doc.getElementById("zen-boost-zap"); + const zapEnabled = await actor.sendQuery("ZenBoost:ZapModeEnabled"); + // Checks if there are any zaps + const zapAny = await actor.sendQuery("ZenBoost:ZapModeAny"); - zapButton.setAttribute("enabled", zapEnabled ? "true" : "false"); + zapButton.setAttribute("enabled", (zapEnabled || zapAny) ? "true" : "false"); } async onUpdatePickerButtonVisual() { @@ -1295,6 +1298,7 @@ ${cssSelector} { this.updateDot(); this.updateCircleRadius(); this.onUpdateZapValue(); + this.onUpdateZapButtonVisual(); } /** diff --git a/src/zen/boosts/actors/ZenBoostsChild.sys.mjs b/src/zen/boosts/actors/ZenBoostsChild.sys.mjs index 855d80ce4..a40acd325 100644 --- a/src/zen/boosts/actors/ZenBoostsChild.sys.mjs +++ b/src/zen/boosts/actors/ZenBoostsChild.sys.mjs @@ -262,6 +262,9 @@ export class ZenBoostsChild extends JSWindowActorChild { break; case "ZenBoost:ZapModeEnabled": return this.#currentState === ZenBoostsChild.STATES.ZAP; + case "ZenBoost:ZapModeAny": + const { boostData } = (await this.getWebsiteBoost()).boostEntry; + return boostData.zapSelectors.length > 0; case "ZenBoost:SelectorPickerModeEnabled": return this.#currentState === ZenBoostsChild.STATES.PICKER; case "ZenBoost:OpenInspector": diff --git a/src/zen/boosts/zen-boosts.css b/src/zen/boosts/zen-boosts.css index 805822042..33ab7a011 100644 --- a/src/zen/boosts/zen-boosts.css +++ b/src/zen/boosts/zen-boosts.css @@ -534,11 +534,11 @@ body { } .zen-boost-font-button-active { - background-color: #5454572f !important; + background-color: #5454572f; } .zen-boost-font-button-active:hover { - background-color: #5b5b5c28 !important; + background-color: #5b5b5c28; } @property --mod-button-c1 { From 3a9e2d32708473dbf85520cf8c66bb053615c078 Mon Sep 17 00:00:00 2001 From: FlorianButz Date: Sun, 12 Apr 2026 19:34:45 +0200 Subject: [PATCH 6/7] chore: Remove unecessary !important in css --- src/zen/boosts/zen-selector.css | 4 ++-- src/zen/boosts/zen-zap.css | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/zen/boosts/zen-selector.css b/src/zen/boosts/zen-selector.css index ee3131bc3..7e7cde34e 100644 --- a/src/zen/boosts/zen-selector.css +++ b/src/zen/boosts/zen-selector.css @@ -17,11 +17,11 @@ #select-component { width: min-content; - font-family: system-ui !important; + font-family: system-ui; height: 98px; - pointer-events: auto !important; + pointer-events: auto; transform-origin: top; overflow: hidden; diff --git a/src/zen/boosts/zen-zap.css b/src/zen/boosts/zen-zap.css index d1e2ae940..fd28f1fa3 100644 --- a/src/zen/boosts/zen-zap.css +++ b/src/zen/boosts/zen-zap.css @@ -53,10 +53,10 @@ } #zap-controls-container { - font-family: system-ui !important; + font-family: system-ui; display: flex; - pointer-events: auto !important; + pointer-events: auto; z-index: 999999; bottom: 8px; @@ -92,7 +92,7 @@ } border: none; - background: linear-gradient(0deg, #afafaf 0%, #e5e5e5 100%) !important; + background: linear-gradient(0deg, #afafaf 0%, #e5e5e5 100%); color: #1d1b1b; font-weight: bold; @@ -148,11 +148,11 @@ } #zen-zap-dissolve-canvas { - position: fixed !important; - width: 100% !important; - height: 100% !important; - left: 0 !important; - top: 0 !important; - pointer-events: none !important; - z-index: 2147483647 !important; + position: fixed; + width: 100%; + height: 100%; + left: 0; + top: 0; + pointer-events: none; + z-index: 2147483647; } From e6081b969e43fe5b6543b2c902edd65f2d2951b3 Mon Sep 17 00:00:00 2001 From: FlorianButz Date: Thu, 23 Apr 2026 13:23:10 +0200 Subject: [PATCH 7/7] chore: Fix visibility issue when zap animation plays --- src/zen/boosts/ZenZapOverlayChild.sys.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/zen/boosts/ZenZapOverlayChild.sys.mjs b/src/zen/boosts/ZenZapOverlayChild.sys.mjs index 5635c0c4d..fbdd74d75 100644 --- a/src/zen/boosts/ZenZapOverlayChild.sys.mjs +++ b/src/zen/boosts/ZenZapOverlayChild.sys.mjs @@ -197,10 +197,10 @@ export class ZapOverlay { this.onZapUpdate(); this.window.requestAnimationFrame(() => { - element.style.visibility = "initial"; + element.style.removeProperty("opacity"); }); }); - element.style.visibility = "hidden"; + element.style.setProperty("opacity", "0", "!important"); }); }); } else {