diff --git a/src/browser/components/urlbar/UrlbarInput-sys-mjs.patch b/src/browser/components/urlbar/UrlbarInput-sys-mjs.patch index 9e15ed0fb..eb7ef3cd2 100644 --- a/src/browser/components/urlbar/UrlbarInput-sys-mjs.patch +++ b/src/browser/components/urlbar/UrlbarInput-sys-mjs.patch @@ -1,5 +1,5 @@ diff --git a/browser/components/urlbar/UrlbarInput.sys.mjs b/browser/components/urlbar/UrlbarInput.sys.mjs -index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..ea4f649026077fb6ce9d02b5fe3785c3a28e1f97 100644 +index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..e31ad41ab28b2be67c25c2efc75e9dd1acfd896f 100644 --- a/browser/components/urlbar/UrlbarInput.sys.mjs +++ b/browser/components/urlbar/UrlbarInput.sys.mjs @@ -76,6 +76,13 @@ ChromeUtils.defineLazyGetter(lazy, "logger", () => @@ -146,7 +146,20 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..ea4f649026077fb6ce9d02b5fe3785c3 this.removeAttribute("breakout-extend"); this.#updateTextboxPosition(); } -@@ -2660,7 +2742,7 @@ export class UrlbarInput { +@@ -2595,10 +2677,12 @@ export class UrlbarInput { + return; + } + this.textbox.style.top = px( ++ this.window.gZenVerticalTabsManager._hasSetSingleToolbar ? + this.textbox.parentNode.getBoxQuads({ + ignoreTransforms: true, + flush: false, + })[0].p1.y ++ : -5 + ); + } + +@@ -2660,7 +2744,7 @@ export class UrlbarInput { this.textbox.parentNode.style.setProperty( "--urlbar-container-height", @@ -155,7 +168,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..ea4f649026077fb6ce9d02b5fe3785c3 ); this.textbox.style.setProperty( "--urlbar-height", -@@ -3093,6 +3175,7 @@ export class UrlbarInput { +@@ -3093,6 +3177,7 @@ export class UrlbarInput { } _toggleActionOverride(event) { @@ -163,7 +176,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..ea4f649026077fb6ce9d02b5fe3785c3 if ( event.keyCode == KeyEvent.DOM_VK_SHIFT || event.keyCode == KeyEvent.DOM_VK_ALT || -@@ -3197,7 +3280,7 @@ export class UrlbarInput { +@@ -3197,7 +3282,7 @@ export class UrlbarInput { return val; } let trimmedValue = lazy.UrlbarPrefs.get("trimURLs") @@ -172,7 +185,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..ea4f649026077fb6ce9d02b5fe3785c3 : val; // Only trim value if the directionality doesn't change to RTL and we're not // showing a strikeout https protocol. -@@ -3501,6 +3584,7 @@ export class UrlbarInput { +@@ -3501,6 +3586,7 @@ export class UrlbarInput { resultDetails = null, browser = this.window.gBrowser.selectedBrowser ) { @@ -180,7 +193,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..ea4f649026077fb6ce9d02b5fe3785c3 if (this.isAddressbar) { this.#prepareAddressbarLoad( url, -@@ -3608,6 +3692,10 @@ export class UrlbarInput { +@@ -3608,6 +3694,10 @@ export class UrlbarInput { } reuseEmpty = true; } @@ -191,7 +204,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..ea4f649026077fb6ce9d02b5fe3785c3 if ( where == "tab" && reuseEmpty && -@@ -3615,6 +3703,9 @@ export class UrlbarInput { +@@ -3615,6 +3705,9 @@ export class UrlbarInput { ) { where = "current"; } @@ -201,7 +214,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..ea4f649026077fb6ce9d02b5fe3785c3 return where; } -@@ -3872,6 +3963,7 @@ export class UrlbarInput { +@@ -3872,6 +3965,7 @@ export class UrlbarInput { this.setResultForCurrentValue(null); this.handleCommand(); this.controller.clearLastQueryContextCache(); @@ -209,7 +222,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..ea4f649026077fb6ce9d02b5fe3785c3 this._suppressStartQuery = false; }); -@@ -3879,7 +3971,6 @@ export class UrlbarInput { +@@ -3879,7 +3973,6 @@ export class UrlbarInput { contextMenu.addEventListener("popupshowing", () => { // Close the results pane when the input field contextual menu is open, // because paste and go doesn't want a result selection. @@ -217,7 +230,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..ea4f649026077fb6ce9d02b5fe3785c3 let controller = this.document.commandDispatcher.getControllerForCommand("cmd_paste"); -@@ -3991,7 +4082,11 @@ export class UrlbarInput { +@@ -3991,7 +4084,11 @@ export class UrlbarInput { if (!engineName && !source && !this.hasAttribute("searchmode")) { return; } @@ -230,7 +243,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..ea4f649026077fb6ce9d02b5fe3785c3 if (this._searchModeIndicatorTitle) { this._searchModeIndicatorTitle.textContent = ""; this._searchModeIndicatorTitle.removeAttribute("data-l10n-id"); -@@ -4302,6 +4397,7 @@ export class UrlbarInput { +@@ -4302,6 +4399,7 @@ export class UrlbarInput { this.document.l10n.setAttributes( this.inputField, @@ -238,7 +251,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..ea4f649026077fb6ce9d02b5fe3785c3 l10nId, l10nId == "urlbar-placeholder-with-name" ? { name } : undefined ); -@@ -4413,6 +4509,11 @@ export class UrlbarInput { +@@ -4413,6 +4511,11 @@ export class UrlbarInput { } _on_click(event) { @@ -250,7 +263,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..ea4f649026077fb6ce9d02b5fe3785c3 if ( event.target == this.inputField || event.target == this._inputContainer -@@ -4485,7 +4586,7 @@ export class UrlbarInput { +@@ -4485,7 +4588,7 @@ export class UrlbarInput { } } @@ -259,7 +272,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..ea4f649026077fb6ce9d02b5fe3785c3 this.view.autoOpen({ event }); } else { if (this._untrimOnFocusAfterKeydown) { -@@ -4525,9 +4626,16 @@ export class UrlbarInput { +@@ -4525,9 +4628,16 @@ export class UrlbarInput { } _on_mousedown(event) { @@ -277,7 +290,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..ea4f649026077fb6ce9d02b5fe3785c3 if ( event.target != this.inputField && -@@ -4538,6 +4646,10 @@ export class UrlbarInput { +@@ -4538,6 +4648,10 @@ export class UrlbarInput { this.focusedViaMousedown = !this.focused; this._preventClickSelectsAll = this.focused; @@ -288,7 +301,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..ea4f649026077fb6ce9d02b5fe3785c3 // Keep the focus status, since the attribute may be changed // upon calling this.focus(). -@@ -4573,7 +4685,7 @@ export class UrlbarInput { +@@ -4573,7 +4687,7 @@ export class UrlbarInput { } // Don't close the view when clicking on a tab; we may want to keep the // view open on tab switch, and the TabSelect event arrived earlier. @@ -297,7 +310,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..ea4f649026077fb6ce9d02b5fe3785c3 break; } -@@ -4890,7 +5002,7 @@ export class UrlbarInput { +@@ -4890,7 +5004,7 @@ export class UrlbarInput { // When we are in actions search mode we can show more results so // increase the limit. let maxResults = diff --git a/src/browser/themes/shared/identity-block/identity-block-css.patch b/src/browser/themes/shared/identity-block/identity-block-css.patch index 32a0bd35f..13df820cf 100644 --- a/src/browser/themes/shared/identity-block/identity-block-css.patch +++ b/src/browser/themes/shared/identity-block/identity-block-css.patch @@ -1,17 +1,22 @@ diff --git a/browser/themes/shared/identity-block/identity-block.css b/browser/themes/shared/identity-block/identity-block.css -index 8edca63dc52ec207475ed9965559d28c06e27971..884343473857c6b6256922d47085fac6eabe74fb 100644 +index 8edca63dc52ec207475ed9965559d28c06e27971..a5a949be1868af5d0bb04747a9f5b737c00ae49c 100644 --- a/browser/themes/shared/identity-block/identity-block.css +++ b/browser/themes/shared/identity-block/identity-block.css -@@ -83,7 +83,7 @@ +@@ -81,13 +81,6 @@ + } + } - #identity-box[pageproxystate="valid"]:is(.notSecureText, .chromeUI, .extensionPage) > .identity-box-button, - #urlbar-label-box { +-#identity-box[pageproxystate="valid"]:is(.notSecureText, .chromeUI, .extensionPage) > .identity-box-button, +-#urlbar-label-box { - background-color: var(--urlbar-box-bgcolor); -+ background-color: transparent; - color: var(--urlbar-box-text-color); - padding-inline: 8px; - border-radius: var(--urlbar-icon-border-radius); -@@ -178,16 +178,17 @@ +- color: var(--urlbar-box-text-color); +- padding-inline: 8px; +- border-radius: var(--urlbar-icon-border-radius); +-} + + #urlbar[focused] { + #identity-box[pageproxystate="valid"]:is(.notSecureText, .chromeUI, .extensionPage) > .identity-box-button:not(:hover, [open]), +@@ -178,16 +171,17 @@ } #identity-icon { diff --git a/src/browser/themes/shared/zen-icons/icons.css b/src/browser/themes/shared/zen-icons/icons.css index ca3d21e8b..9cddd5e1f 100644 --- a/src/browser/themes/shared/zen-icons/icons.css +++ b/src/browser/themes/shared/zen-icons/icons.css @@ -662,22 +662,6 @@ list-style-image: url('tab-audio-blocked-small.svg') !important; } -/* reload/stop animation */ -#stop-reload-button[animate] - > #reload-button[displaystop] - + #stop-button - > .toolbarbutton-animatable-box - > .toolbarbutton-animatable-image { - background-image: url('reload-to-stop.svg') !important; -} - -#stop-reload-button[animate] - > #reload-button - > .toolbarbutton-animatable-box - > .toolbarbutton-animatable-image { - background-image: url('stop-to-reload.svg') !important; -} - #reader-mode-button > .urlbar-icon, #zen-site-data-header-reader-mode { list-style-image: url('reader-mode.svg') !important; @@ -950,4 +934,5 @@ #zen-copy-url-button image { list-style-image: url('link.svg'); + fill-opacity: 0.7; } diff --git a/src/browser/themes/shared/zen-icons/jar.inc.mn b/src/browser/themes/shared/zen-icons/jar.inc.mn index e27e79524..b97b3837b 100644 --- a/src/browser/themes/shared/zen-icons/jar.inc.mn +++ b/src/browser/themes/shared/zen-icons/jar.inc.mn @@ -111,7 +111,6 @@ * skin/classic/browser/zen-icons/private-window.svg (../shared/zen-icons/lin/private-window.svg) * skin/classic/browser/zen-icons/privateBrowsing.svg (../shared/zen-icons/lin/privateBrowsing.svg) * skin/classic/browser/zen-icons/reader-mode.svg (../shared/zen-icons/lin/reader-mode.svg) -* skin/classic/browser/zen-icons/reload-to-stop.svg (../shared/zen-icons/lin/reload-to-stop.svg) * skin/classic/browser/zen-icons/reload.svg (../shared/zen-icons/lin/reload.svg) * skin/classic/browser/zen-icons/report.svg (../shared/zen-icons/lin/report.svg) * skin/classic/browser/zen-icons/save.svg (../shared/zen-icons/lin/save.svg) @@ -134,7 +133,6 @@ * skin/classic/browser/zen-icons/sparkles.svg (../shared/zen-icons/lin/sparkles.svg) * skin/classic/browser/zen-icons/spell-check.svg (../shared/zen-icons/lin/spell-check.svg) * skin/classic/browser/zen-icons/split.svg (../shared/zen-icons/lin/split.svg) -* skin/classic/browser/zen-icons/stop-to-reload.svg (../shared/zen-icons/lin/stop-to-reload.svg) * skin/classic/browser/zen-icons/tab-audio-blocked-small.svg (../shared/zen-icons/lin/tab-audio-blocked-small.svg) * skin/classic/browser/zen-icons/tab-audio-muted-small.svg (../shared/zen-icons/lin/tab-audio-muted-small.svg) * skin/classic/browser/zen-icons/tab-audio-playing-small.svg (../shared/zen-icons/lin/tab-audio-playing-small.svg) @@ -265,7 +263,6 @@ * skin/classic/browser/zen-icons/private-window.svg (../shared/zen-icons/lin/private-window.svg) * skin/classic/browser/zen-icons/privateBrowsing.svg (../shared/zen-icons/lin/privateBrowsing.svg) * skin/classic/browser/zen-icons/reader-mode.svg (../shared/zen-icons/lin/reader-mode.svg) -* skin/classic/browser/zen-icons/reload-to-stop.svg (../shared/zen-icons/lin/reload-to-stop.svg) * skin/classic/browser/zen-icons/reload.svg (../shared/zen-icons/lin/reload.svg) * skin/classic/browser/zen-icons/report.svg (../shared/zen-icons/lin/report.svg) * skin/classic/browser/zen-icons/save.svg (../shared/zen-icons/lin/save.svg) @@ -288,7 +285,6 @@ * skin/classic/browser/zen-icons/sparkles.svg (../shared/zen-icons/lin/sparkles.svg) * skin/classic/browser/zen-icons/spell-check.svg (../shared/zen-icons/lin/spell-check.svg) * skin/classic/browser/zen-icons/split.svg (../shared/zen-icons/lin/split.svg) -* skin/classic/browser/zen-icons/stop-to-reload.svg (../shared/zen-icons/lin/stop-to-reload.svg) * skin/classic/browser/zen-icons/tab-audio-blocked-small.svg (../shared/zen-icons/lin/tab-audio-blocked-small.svg) * skin/classic/browser/zen-icons/tab-audio-muted-small.svg (../shared/zen-icons/lin/tab-audio-muted-small.svg) * skin/classic/browser/zen-icons/tab-audio-playing-small.svg (../shared/zen-icons/lin/tab-audio-playing-small.svg) @@ -419,7 +415,6 @@ * skin/classic/browser/zen-icons/private-window.svg (../shared/zen-icons/lin/private-window.svg) * skin/classic/browser/zen-icons/privateBrowsing.svg (../shared/zen-icons/lin/privateBrowsing.svg) * skin/classic/browser/zen-icons/reader-mode.svg (../shared/zen-icons/lin/reader-mode.svg) -* skin/classic/browser/zen-icons/reload-to-stop.svg (../shared/zen-icons/lin/reload-to-stop.svg) * skin/classic/browser/zen-icons/reload.svg (../shared/zen-icons/lin/reload.svg) * skin/classic/browser/zen-icons/report.svg (../shared/zen-icons/lin/report.svg) * skin/classic/browser/zen-icons/save.svg (../shared/zen-icons/lin/save.svg) @@ -442,7 +437,6 @@ * skin/classic/browser/zen-icons/sparkles.svg (../shared/zen-icons/lin/sparkles.svg) * skin/classic/browser/zen-icons/spell-check.svg (../shared/zen-icons/lin/spell-check.svg) * skin/classic/browser/zen-icons/split.svg (../shared/zen-icons/lin/split.svg) -* skin/classic/browser/zen-icons/stop-to-reload.svg (../shared/zen-icons/lin/stop-to-reload.svg) * skin/classic/browser/zen-icons/tab-audio-blocked-small.svg (../shared/zen-icons/lin/tab-audio-blocked-small.svg) * skin/classic/browser/zen-icons/tab-audio-muted-small.svg (../shared/zen-icons/lin/tab-audio-muted-small.svg) * skin/classic/browser/zen-icons/tab-audio-playing-small.svg (../shared/zen-icons/lin/tab-audio-playing-small.svg) diff --git a/src/browser/themes/shared/zen-icons/lin/reload-to-stop.svg b/src/browser/themes/shared/zen-icons/lin/reload-to-stop.svg deleted file mode 100644 index e4c0f09cc..000000000 --- a/src/browser/themes/shared/zen-icons/lin/reload-to-stop.svg +++ /dev/null @@ -1,32 +0,0 @@ -#filter dumbComments emptyLines substitution -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/browser/themes/shared/zen-icons/lin/stop-to-reload.svg b/src/browser/themes/shared/zen-icons/lin/stop-to-reload.svg deleted file mode 100644 index ac36f0afa..000000000 --- a/src/browser/themes/shared/zen-icons/lin/stop-to-reload.svg +++ /dev/null @@ -1,39 +0,0 @@ -#filter dumbComments emptyLines substitution -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/zen/common/ZenCustomizableUI.sys.mjs b/src/zen/common/ZenCustomizableUI.sys.mjs index 81359f7ed..e748b5b71 100644 --- a/src/zen/common/ZenCustomizableUI.sys.mjs +++ b/src/zen/common/ZenCustomizableUI.sys.mjs @@ -71,6 +71,7 @@ export var ZenCustomizableUI = new (class { diff --git a/src/zen/common/styles/zen-browser-container.css b/src/zen/common/styles/zen-browser-container.css index c06def63c..db466d89c 100644 --- a/src/zen/common/styles/zen-browser-container.css +++ b/src/zen/common/styles/zen-browser-container.css @@ -49,6 +49,7 @@ :root[zen-single-toolbar='true'] & { transition-delay: 0.2s; + --zen-toolbar-height: 34px; } #tabbrowser-tabpanels[has-toolbar-hovered] & { diff --git a/src/zen/common/styles/zen-omnibox.css b/src/zen/common/styles/zen-omnibox.css index ce465f3a5..3cefc3856 100644 --- a/src/zen/common/styles/zen-omnibox.css +++ b/src/zen/common/styles/zen-omnibox.css @@ -114,7 +114,7 @@ border-radius: 0px !important; } -#urlbar:not([breakout-extend='true']) .urlbar-input-box { +#urlbar .urlbar-input-box { font-weight: 500; } @@ -151,19 +151,35 @@ :root:not([zen-single-toolbar='true']) #urlbar:not([breakout-extend='true']) .urlbar-input-container:not([pageproxystate='invalid']) { - flex-direction: row-reverse; + padding: 2px 3px; gap: 2px; - padding: 2px; & .urlbar-page-action { height: 100%; } + & #zen-copy-url-button { + order: -1; + } + & #identity-box { + order: 999; margin: 0px !important; } } +#zen-copy-url-button[disabled] { + opacity: 0.3; + background: transparent !important; +} + +:root[zen-single-toolbar='true'], +#urlbar:is([breakout-extend='true'], [pageproxystate='invalid']) { + #zen-copy-url-button[disabled] { + display: none !important; + } +} + .urlbar-page-action, #tracking-protection-icon-container { padding: 0 !important; @@ -204,7 +220,8 @@ #urlbar[breakout-extend='true'] { z-index: 2; - & .urlbar-input-container { + :root[zen-single-toolbar='true'] & .urlbar-input-box, + &[zen-floating-urlbar='true'] .urlbar-input-box { font-weight: 400; @media (-moz-platform: windows) { font-weight: 500; @@ -212,10 +229,15 @@ } & #identity-box { - margin-right: calc(var(--urlbar-margin-inline) - 1px); height: 100%; } + :root:not([zen-single-toolbar='true']) + &:not([zen-floating-urlbar='true']) + #identity-box:not([pageproxystate='invalid']) { + margin-inline-end: 0; + } + & .urlbar-background { --zen-urlbar-background-base: light-dark( #fbfbfb, diff --git a/src/zen/compact-mode/ZenCompactMode.mjs b/src/zen/compact-mode/ZenCompactMode.mjs index 83f8303be..6e691f507 100644 --- a/src/zen/compact-mode/ZenCompactMode.mjs +++ b/src/zen/compact-mode/ZenCompactMode.mjs @@ -202,6 +202,7 @@ var gZenCompactModeManager = { }, updateCompactModeContext(isSingleToolbar) { + isSingleToolbar ||= this.checkIfIllegalState(); const menuitem = document.getElementById('zen-context-menu-compact-mode-toggle'); const menu = document.getElementById('zen-context-menu-compact-mode'); if (isSingleToolbar) { @@ -231,6 +232,37 @@ var gZenCompactModeManager = { this.callAllEventListeners(); }, + /* Check for illegal states and fix them + * @returns {boolean} If the context menu should just show the "toggle" item + * instead of a submenu with hide options + */ + checkIfIllegalState() { + // Due to how we layout the sidebar and toolbar, there are some states + // that are not allowed mainly due to the caption buttons not being accessible + // at the top left/right of the window. + const isSidebarExpanded = gZenVerticalTabsManager._prefsSidebarExpanded; + if (isSidebarExpanded) { + // Fast exit if the sidebar is expanded, as we dont have illegal states then + return false; + } + const canHideSidebar = this.canHideSidebar; + const canHideToolbar = this.canHideToolbar; + const isLeftSideButtons = !gZenVerticalTabsManager.isWindowsStyledButtons; + const isRightSidebar = gZenVerticalTabsManager._prefsRightSide; + // on macos: collapsed + left side + only toolbar + // on windows: collapsed + right side + only toolbar + const closelyIllegalState = + (isLeftSideButtons && !isRightSidebar) || (!isLeftSideButtons && isRightSidebar); + if (closelyIllegalState && canHideToolbar && !canHideSidebar) { + // This state is illegal + Services.prefs.setBoolPref('zen.view.compact.hide-tabbar', true); + Services.prefs.setBoolPref('zen.view.compact.hide-toolbar', false); + this.callAllEventListeners(); + return true; + } + return closelyIllegalState; + }, + callAllEventListeners() { this._eventListeners.forEach((callback) => callback()); }, @@ -309,6 +341,13 @@ var gZenCompactModeManager = { ); }, + get canHideToolbar() { + return ( + Services.prefs.getBoolPref('zen.view.compact.hide-toolbar') && + !gZenVerticalTabsManager._hasSetSingleToolbar + ); + }, + animateCompactMode() { // Get the splitter width before hiding it (we need to hide it before animating on right) document.documentElement.setAttribute('zen-compact-animating', 'true'); @@ -464,14 +503,17 @@ var gZenCompactModeManager = { .getElementById('zen-context-menu-compact-mode-toggle') .setAttribute('checked', this.preference); - const hideTabBar = Services.prefs.getBoolPref('zen.view.compact.hide-tabbar', false); - const hideToolbar = Services.prefs.getBoolPref('zen.view.compact.hide-toolbar', false); + const hideTabBar = this.canHideSidebar; + const hideToolbar = this.canHideToolbar; const hideBoth = hideTabBar && hideToolbar; const idName = 'zen-context-menu-compact-mode-hide-'; - document.getElementById(idName + 'sidebar').setAttribute('checked', !hideBoth && hideTabBar); - document.getElementById(idName + 'toolbar').setAttribute('checked', !hideBoth && hideToolbar); - document.getElementById(idName + 'both').setAttribute('checked', hideBoth); + const sidebarItem = document.getElementById(idName + 'sidebar'); + const toolbarItem = document.getElementById(idName + 'toolbar'); + const bothItem = document.getElementById(idName + 'both'); + sidebarItem.setAttribute('checked', !hideBoth && hideTabBar); + toolbarItem.setAttribute('checked', !hideBoth && hideToolbar); + bothItem.setAttribute('checked', hideBoth); }, _removeOpenStateOnUnifiedExtensions() { diff --git a/src/zen/urlbar/ZenSiteDataPanel.sys.mjs b/src/zen/urlbar/ZenSiteDataPanel.sys.mjs index ec2bda8c1..91f648636 100644 --- a/src/zen/urlbar/ZenSiteDataPanel.sys.mjs +++ b/src/zen/urlbar/ZenSiteDataPanel.sys.mjs @@ -76,21 +76,29 @@ export class nsZenSiteDataPanel { class="urlbar-page-action" role="button" data-l10n-id="zen-urlbar-copy-url-button" - hidden="true"> + disabled="true"> `); - container.appendChild(fragment); + container.after(fragment); const aElement = this.document.getElementById('zen-copy-url-button'); aElement.addEventListener('click', () => { + if (aElement.hasAttribute('disabled')) { + return; + } this.document.getElementById('cmd_zenCopyCurrentURL').doCommand(); }); this.window.gBrowser.addProgressListener({ onLocationChange: (aWebProgress, aRequest, aLocation) => { if (aWebProgress.isTopLevel) { - aElement.hidden = !this.#canCopyUrl(aLocation); + const disabled = !this.#canCopyUrl(aLocation); + if (disabled) { + aElement.setAttribute('disabled', true); + } else { + aElement.removeAttribute('disabled'); + } } }, }); @@ -524,7 +532,11 @@ export class nsZenSiteDataPanel { break; } default: { - const label = event.target.closest('.permission-popup-permission-label-container'); + const item = event.target.closest('.permission-popup-permission-item'); + if (!item) { + break; + } + const label = item.querySelector('.permission-popup-permission-label-container'); if (label?._permission) { this.#onPermissionClick(label); }