fix(zen-browser): replace transparent-zen with patched version that respects ignore list#171
Open
dbeley wants to merge 1 commit into
Open
fix(zen-browser): replace transparent-zen with patched version that respects ignore list#171dbeley wants to merge 1 commit into
dbeley wants to merge 1 commit into
Conversation
…respects ignore list The upstream transparent-zen has a bug: when switching tabs, blacklisted tabs (in the ignore list) still get transparency styles applied because the background script injects CSS into ALL tabs regardless of the blacklist. This adds a Nix overlay that replaces the NUR transparent-zen package with a version built from a patched fork, containing two fixes: 1. Background script (applyStyles): when injecting styles globally, check each tab's hostname against the blacklistedDomains setting and skip tabs that should be excluded (or only include whitelisted ones in whitelist mode). 2. Content script (updateSettings handler): when settings change (e.g. a domain is added to the ignore list), re-evaluate and remove transparency styles from tabs that are now excluded. The package is built from source using buildNpmPackage, with patches already applied on the forked branch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The upstream transparent-zen addon has a bug where blacklisted tabs (in the ignore list) still get transparency styles applied when switching tabs. This happens because the background script (
applyStyles) injects CSS into all tabs in the current window, ignoring the blacklist.This PR replaces the NUR transparent-zen package with a version built from a patched fork containing two fixes:
Fix 1 — Background script (
applyStyles)When injecting
dynamic-transparency.cssglobally (no specific domains targetted), the background script now reads the extension settings and checks each tab's hostname againstblacklistedDomains. Tabs whose domain is in the ignore list are skipped (or only included if in whitelist mode).Fix 2 — Content script (
updateSettingshandler)When the user adds a domain to the ignore list from the settings page, an
updateSettingsmessage is sent but there was no handler for it. Now the content script re-evaluates and removes transparency styles from tabs that should no longer have them — no manual reload needed.Changes
apps/zen-browser/transparent-zen-patched.nix— builds the patched extension from source usingbuildNpmPackagemodules/overlays.nix— overlay replacesnur.repos.rycee.firefox-addons.transparent-zenwith the patched version, affecting both Firefox and Zen Browser