refactor: update configuration and initialization for Zen application

This commit is contained in:
mr. M
2025-03-26 23:28:30 +01:00
parent daf6d6aea8
commit c3e33fa7f3
8 changed files with 59 additions and 30 deletions

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/customizableui/CustomizableUI.sys.mjs b/browser/components/customizableui/CustomizableUI.sys.mjs
index 9392b42a1de7310719a6cc8aaf11bd857e8fa69a..6a68b53443d32461927ef98d770b297caaecf790 100644
index 9392b42a1de7310719a6cc8aaf11bd857e8fa69a..20248e5c0e38d4de3349687157b6aeb40339488d 100644
--- a/browser/components/customizableui/CustomizableUI.sys.mjs
+++ b/browser/components/customizableui/CustomizableUI.sys.mjs
@@ -13,6 +13,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
@@ -95,7 +95,7 @@ index 9392b42a1de7310719a6cc8aaf11bd857e8fa69a..6a68b53443d32461927ef98d770b297c
}
}
-
+ ZenCustomizableUI.init(window);
+ lazy.ZenCustomizableUI.init(aWindow);
// Now register all the toolbars
for (let area of CustomizableUI.areas) {
let type = CustomizableUI.getAreaType(area);
@@ -106,7 +106,7 @@ index 9392b42a1de7310719a6cc8aaf11bd857e8fa69a..6a68b53443d32461927ef98d770b297c
}
}
-
+ ZenCustomizableUI.registerToolbarNodes(window);
+ lazy.ZenCustomizableUI.registerToolbarNodes(aWindow);
// Handle initial state of vertical tabs.
if (isVerticalTabs) {
// Show the vertical tabs toolbar

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
index 0dc763824f390b4964489ac4e071ed6d41cc41db..3e0be2c686a162038e99b31fdbcf9832f184a629 100644
index 0dc763824f390b4964489ac4e071ed6d41cc41db..fd0756885990f9da34390603d13fd8851844e982 100644
--- a/browser/components/tabbrowser/content/tabbrowser.js
+++ b/browser/components/tabbrowser/content/tabbrowser.js
@@ -424,11 +424,50 @@
@@ -656,7 +656,7 @@ index 0dc763824f390b4964489ac4e071ed6d41cc41db..3e0be2c686a162038e99b31fdbcf9832
!this.contextTabs[0].group &&
(this.contextTabs[0] == visibleTabs[0] ||
- this.contextTabs[0] == visibleTabs[gBrowser.pinnedTabCount]);
+ this.contextTabs[0] == visibleTabs[gBrowser._numVisiblePinTabs];
+ this.contextTabs[0] == visibleTabs[gBrowser._numVisiblePinTabs]);
contextMoveTabToStart.disabled = isFirstTab && allSelectedTabsAdjacent;
document.getElementById("context_openTabInWindow").disabled =

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/urlbar/UrlbarInput.sys.mjs b/browser/components/urlbar/UrlbarInput.sys.mjs
index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..79b9161544633d319d7e550dd95334b62e85eed4 100644
index 6de4c2ac873b1424abee118a143ac377f26beb80..3b41d52c8e00860ce9913a334f15f70e1db08a7c 100644
--- a/browser/components/urlbar/UrlbarInput.sys.mjs
+++ b/browser/components/urlbar/UrlbarInput.sys.mjs
@@ -67,6 +67,13 @@ XPCOMUtils.defineLazyPreferenceGetter(
@@ -16,7 +16,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..79b9161544633d319d7e550dd95334b6
const DEFAULT_FORM_HISTORY_NAME = "searchbar-history";
const SEARCH_BUTTON_CLASS = "urlbar-search-button";
@@ -349,7 +356,11 @@ export class UrlbarInput {
@@ -348,7 +355,11 @@ export class UrlbarInput {
// See _on_select(). HTMLInputElement.select() dispatches a "select"
// event but does not set the primary selection.
this._suppressPrimaryAdjustment = true;
@@ -28,7 +28,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..79b9161544633d319d7e550dd95334b6
this._suppressPrimaryAdjustment = false;
}
@@ -425,6 +436,10 @@ export class UrlbarInput {
@@ -424,6 +435,10 @@ export class UrlbarInput {
hideSearchTerms = false,
isSameDocument = false
) {
@@ -39,7 +39,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..79b9161544633d319d7e550dd95334b6
// We only need to update the searchModeUI on tab switch conditionally
// as we only persist searchMode with ScotchBonnet enabled.
if (
@@ -698,8 +713,11 @@ export class UrlbarInput {
@@ -697,8 +712,11 @@ export class UrlbarInput {
return;
}
}
@@ -52,7 +52,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..79b9161544633d319d7e550dd95334b6
}
/**
@@ -943,6 +961,10 @@ export class UrlbarInput {
@@ -937,6 +955,10 @@ export class UrlbarInput {
// Nullify search mode before setURI so it won't try to restore it.
this.searchMode = null;
this.setURI(null, true, false, true);
@@ -63,7 +63,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..79b9161544633d319d7e550dd95334b6
if (this.value && this.focused) {
this.select();
}
@@ -1098,7 +1120,11 @@ export class UrlbarInput {
@@ -1092,7 +1114,11 @@ export class UrlbarInput {
}
if (!this.#providesSearchMode(result)) {
@@ -76,7 +76,18 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..79b9161544633d319d7e550dd95334b6
}
this.controller.recordSelectedResult(event, result);
@@ -2157,6 +2183,11 @@ export class UrlbarInput {
@@ -2124,6 +2150,10 @@ export class UrlbarInput {
await this.#updateLayoutBreakoutDimensions();
}
+ async zenUpdateLayoutBreakout() {
+ await this.#updateLayoutBreakout();
+ }
+
startLayoutExtend() {
if (!this.#allowBreakout || this.hasAttribute("breakout-extend")) {
// Do not expand if the Urlbar does not support being expanded or it is
@@ -2146,6 +2176,11 @@ export class UrlbarInput {
this.setAttribute("breakout-extend", "true");
@@ -88,7 +99,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..79b9161544633d319d7e550dd95334b6
// Enable the animation only after the first extend call to ensure it
// doesn't run when opening a new window.
if (!this.hasAttribute("breakout-extend-animate")) {
@@ -2176,6 +2207,11 @@ export class UrlbarInput {
@@ -2165,6 +2200,11 @@ export class UrlbarInput {
return;
}
@@ -100,7 +111,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..79b9161544633d319d7e550dd95334b6
this.removeAttribute("breakout-extend");
this.#updateTextboxPosition();
}
@@ -2998,7 +3034,7 @@ export class UrlbarInput {
@@ -2997,7 +3037,7 @@ export class UrlbarInput {
*/
_trimValue(val) {
let trimmedValue = lazy.UrlbarPrefs.get("trimURLs")
@@ -109,7 +120,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..79b9161544633d319d7e550dd95334b6
: val;
// Only trim value if the directionality doesn't change to RTL and we're not
// showing a strikeout https protocol.
@@ -3365,7 +3401,7 @@ export class UrlbarInput {
@@ -3359,7 +3399,7 @@ export class UrlbarInput {
} else {
where = lazy.BrowserUtils.whereToOpenLink(event, false, false);
}
@@ -118,7 +129,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..79b9161544633d319d7e550dd95334b6
if (where == "current") {
where = "tab";
} else if (where == "tab") {
@@ -3380,6 +3416,9 @@ export class UrlbarInput {
@@ -3374,6 +3414,9 @@ export class UrlbarInput {
) {
where = "current";
}
@@ -128,7 +139,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..79b9161544633d319d7e550dd95334b6
return where;
}
@@ -3921,6 +3960,11 @@ export class UrlbarInput {
@@ -4048,6 +4091,11 @@ export class UrlbarInput {
}
_on_click(event) {
@@ -140,7 +151,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..79b9161544633d319d7e550dd95334b6
if (
event.target == this.inputField ||
event.target == this._inputContainer ||
@@ -3992,7 +4036,7 @@ export class UrlbarInput {
@@ -4119,7 +4167,7 @@ export class UrlbarInput {
}
}
@@ -149,7 +160,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..79b9161544633d319d7e550dd95334b6
this.view.autoOpen({ event });
} else {
if (this._untrimOnFocusAfterKeydown) {
@@ -4032,9 +4076,12 @@ export class UrlbarInput {
@@ -4159,9 +4207,12 @@ export class UrlbarInput {
}
_on_mousedown(event) {
@@ -163,7 +174,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..79b9161544633d319d7e550dd95334b6
if (
event.target != this.inputField &&
@@ -4044,8 +4091,8 @@ export class UrlbarInput {
@@ -4171,8 +4222,8 @@ export class UrlbarInput {
break;
}