mirror of
https://github.com/zen-browser/desktop.git
synced 2026-06-30 22:36:36 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
11a7ff3ad5 | ||
|
|
2db6ff9346 | ||
|
|
4e9c958f8d | ||
|
|
54692261f8 | ||
|
|
1fdc1d4475 | ||
|
|
9f9ae52c63 | ||
|
|
3c3322058e | ||
|
|
31bb9d606d | ||
|
|
b6cb8338e3 |
@@ -34,8 +34,8 @@ Zen is a firefox-based browser with the aim of pushing your productivity to a ne
|
|||||||
|
|
||||||
### Firefox Versions
|
### Firefox Versions
|
||||||
|
|
||||||
- [`Release`](https://zen-browser.app/download) - Is currently built using Firefox version `152.0.1`! 🚀
|
- [`Release`](https://zen-browser.app/download) - Is currently built using Firefox version `152.0.3`! 🚀
|
||||||
- [`Twilight`](https://zen-browser.app/download?twilight) - Is currently built using Firefox version `RC 152.0.1`!
|
- [`Twilight`](https://zen-browser.app/download?twilight) - Is currently built using Firefox version `RC 152.0.3`!
|
||||||
|
|
||||||
### Contributing
|
### Contributing
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
2960f4c1ce58d289d3b9ec885695f0017d2636ab
|
b223f3727a037a7b8a0f36f34bfe8c4622a7f387
|
||||||
@@ -19,13 +19,19 @@ tab-context-zen-add-essential-badge = { $num } / { $max }
|
|||||||
tab-context-zen-remove-essential =
|
tab-context-zen-remove-essential =
|
||||||
.label = Remove from Essentials
|
.label = Remove from Essentials
|
||||||
.accesskey = R
|
.accesskey = R
|
||||||
tab-context-zen-replace-pinned-url-with-current =
|
tab-context-zen-edit-pinned-page =
|
||||||
.label =
|
.label =
|
||||||
{ $isEssential ->
|
{ $isEssential ->
|
||||||
[true] Replace Essential URL with Current
|
[true] Edit Essential URL
|
||||||
*[false] Replace Pinned URL with Current
|
*[false] Edit Pinned URL
|
||||||
}
|
}
|
||||||
|
.accesskey = P
|
||||||
|
tab-context-zen-replace-pinned-url-with-current =
|
||||||
|
.label = Replace with Current URL
|
||||||
.accesskey = C
|
.accesskey = C
|
||||||
|
tab-context-zen-edit-pinned-url =
|
||||||
|
.label = Edit...
|
||||||
|
.accesskey = E
|
||||||
tab-context-zen-edit-title =
|
tab-context-zen-edit-title =
|
||||||
.label = Change Label...
|
.label = Change Label...
|
||||||
tab-context-zen-edit-icon =
|
tab-context-zen-edit-icon =
|
||||||
@@ -55,6 +61,10 @@ zen-general-confirm =
|
|||||||
.label = Confirm
|
.label = Confirm
|
||||||
|
|
||||||
zen-pinned-tab-replaced = Pinned tab URL has been replaced with the current URL!
|
zen-pinned-tab-replaced = Pinned tab URL has been replaced with the current URL!
|
||||||
|
zen-pinned-tab-url-edited = Pinned tab URL has been updated!
|
||||||
|
zen-pinned-tab-url-invalid = That doesn't look like a valid URL.
|
||||||
|
zen-pinned-tab-edit-url-title = Edit Pinned URL
|
||||||
|
zen-pinned-tab-edit-url-label = Enter the URL this pinned tab should point to:
|
||||||
zen-tabs-renamed = Tab has been successfully renamed!
|
zen-tabs-renamed = Tab has been successfully renamed!
|
||||||
zen-background-tab-opened-toast = New background tab opened!
|
zen-background-tab-opened-toast = New background tab opened!
|
||||||
zen-workspace-renamed-toast = Workspace has been successfully renamed!
|
zen-workspace-renamed-toast = Workspace has been successfully renamed!
|
||||||
|
|||||||
@@ -25,3 +25,9 @@ zen-space-routing-open-in = Open In
|
|||||||
zen-space-routing-url = URL
|
zen-space-routing-url = URL
|
||||||
|
|
||||||
zen-space-routing-tab-routed-toast = New tab opened in { $targetWorkspace }
|
zen-space-routing-tab-routed-toast = New tab opened in { $targetWorkspace }
|
||||||
|
tab-context-zen-add-domain-to-sr =
|
||||||
|
.label =
|
||||||
|
{ $tabCount ->
|
||||||
|
[one] Add Route for Domain
|
||||||
|
*[other] Add Route for Domains
|
||||||
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
"build": "surfer build",
|
"build": "surfer build",
|
||||||
"build:ui": "surfer build --ui",
|
"build:ui": "surfer build --ui",
|
||||||
"start": "cd engine && python3 ./mach run --noprofile",
|
"start": "cd engine && python3 ./mach run --noprofile",
|
||||||
"start:debug": "npm start -- --jsdebugger --wait-for-jsdebugger",
|
|
||||||
"start:bloat": "XPCOM_MEM_BLOAT_LOG=1 npm start",
|
"start:bloat": "XPCOM_MEM_BLOAT_LOG=1 npm start",
|
||||||
"import": "npm run ffprefs && npm run import:dumps && surfer import",
|
"import": "npm run ffprefs && npm run import:dumps && surfer import",
|
||||||
"import:dumps": "python3 scripts/update_service_dumps.py",
|
"import:dumps": "python3 scripts/update_service_dumps.py",
|
||||||
|
|||||||
18
src/browser/base/content/aboutDialog-css.patch
Normal file
18
src/browser/base/content/aboutDialog-css.patch
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
diff --git a/browser/base/content/aboutDialog.css b/browser/base/content/aboutDialog.css
|
||||||
|
index 017125bc2510e5f5e317a5e78c40d6aa9ded76ca..d343d8c62a2251e3c3a33ae8f2ab9c4c68218c22 100644
|
||||||
|
--- a/browser/base/content/aboutDialog.css
|
||||||
|
+++ b/browser/base/content/aboutDialog.css
|
||||||
|
@@ -135,6 +135,13 @@
|
||||||
|
margin: 0 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
+#trademark {
|
||||||
|
+ font-size: xx-small;
|
||||||
|
+ text-align: center;
|
||||||
|
+ margin-block: 10px;
|
||||||
|
+ color: var(--text-color-deemphasized);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
#currentChannel {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
diff --git a/browser/base/content/aboutDialog.xhtml b/browser/base/content/aboutDialog.xhtml
|
diff --git a/browser/base/content/aboutDialog.xhtml b/browser/base/content/aboutDialog.xhtml
|
||||||
index 3ffd464b960a4299a7dd0cd87e4fc2f781b9d593..ef9f42d1f0196902b4af31f4496891fcd6319831 100644
|
index 3ffd464b960a4299a7dd0cd87e4fc2f781b9d593..7a831c8ee2b73bb89bf8a82ac24958b55c16a5aa 100644
|
||||||
--- a/browser/base/content/aboutDialog.xhtml
|
--- a/browser/base/content/aboutDialog.xhtml
|
||||||
+++ b/browser/base/content/aboutDialog.xhtml
|
+++ b/browser/base/content/aboutDialog.xhtml
|
||||||
@@ -102,10 +102,6 @@
|
@@ -102,10 +102,6 @@
|
||||||
@@ -39,8 +39,8 @@ index 3ffd464b960a4299a7dd0cd87e4fc2f781b9d593..ef9f42d1f0196902b4af31f4496891fc
|
|||||||
<label is="text-link" class="bottom-link" useoriginprincipal="true" href="about:license" data-l10n-id="bottomLinks-license"/>
|
<label is="text-link" class="bottom-link" useoriginprincipal="true" href="about:license" data-l10n-id="bottomLinks-license"/>
|
||||||
- <label is="text-link" class="bottom-link" href="https://www.mozilla.org/about/legal/terms/firefox/" data-l10n-id="bottom-links-terms"/>
|
- <label is="text-link" class="bottom-link" href="https://www.mozilla.org/about/legal/terms/firefox/" data-l10n-id="bottom-links-terms"/>
|
||||||
- <label is="text-link" class="bottom-link" href="https://www.mozilla.org/privacy/firefox/?utm_source=firefox-browser&utm_medium=firefox-desktop&utm_campaign=about-dialog" data-l10n-id="bottom-links-privacy"/>
|
- <label is="text-link" class="bottom-link" href="https://www.mozilla.org/privacy/firefox/?utm_source=firefox-browser&utm_medium=firefox-desktop&utm_campaign=about-dialog" data-l10n-id="bottom-links-privacy"/>
|
||||||
+ <label is="text-link" class="bottom-link" href="about:rights" data-l10n-id="bottomLinks-rights"/>
|
+ <label is="text-link" class="bottom-link" href="about:rights" data-l10n-id="bottom-links-terms"/>
|
||||||
+ <label is="text-link" class="bottom-link" href="https://www.zen-browser.app/privacy-policy/" data-l10n-id="bottomLinks-privacy"/>
|
+ <label is="text-link" class="bottom-link" href="https://www.zen-browser.app/privacy-policy/" data-l10n-id="bottom-links-privacy"/>
|
||||||
</hbox>
|
</hbox>
|
||||||
<description id="trademark" data-l10n-id="trademarkInfo"></description>
|
<description id="trademark" data-l10n-id="trademarkInfo"></description>
|
||||||
</vbox>
|
</vbox>
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
<command id="cmd_zenToggleTabsOnRight" />
|
<command id="cmd_zenToggleTabsOnRight" />
|
||||||
|
|
||||||
<command id="cmd_zenReplacePinnedUrlWithCurrent" />
|
<command id="cmd_zenReplacePinnedUrlWithCurrent" />
|
||||||
|
<command id="cmd_zenEditPinnedUrl" />
|
||||||
<command id="cmd_contextZenAddToEssentials" />
|
<command id="cmd_contextZenAddToEssentials" />
|
||||||
<command id="cmd_contextZenRemoveFromEssentials" />
|
<command id="cmd_contextZenRemoveFromEssentials" />
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
|
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
|
||||||
index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe265655d7171ce 100644
|
index 08b5b56e069d038d72c87355920c4ce8a55ed805..87f41c8583c26f364530def5bd5d83330c265dfc 100644
|
||||||
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
||||||
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
||||||
@@ -511,6 +511,7 @@
|
@@ -511,6 +511,7 @@
|
||||||
@@ -285,21 +285,22 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
} = {}
|
} = {}
|
||||||
) {
|
) {
|
||||||
// all callers of addTab that pass a params object need to pass
|
// all callers of addTab that pass a params object need to pass
|
||||||
@@ -3347,10 +3438,24 @@
|
@@ -3347,10 +3438,25 @@
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
+ const beforeRouteResult = window.gZenSpaceRoutingManager.onBeforeAddTab(uriString, { skipRoute, pinned, tabGroup, fromExternal, zenWorkspaceId }, window);
|
+ const beforeRouteResult = window.gZenSpaceRoutingManager.onBeforeAddTab(uriString, { skipRoute, pinned, tabGroup, fromExternal }, window);
|
||||||
+ if (beforeRouteResult.shouldEarlyExit) {
|
+ if (beforeRouteResult.shouldEarlyExit) {
|
||||||
+ return null;
|
+ return null;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ let hasZenDefaultUserContextId = false;
|
+ let hasZenDefaultUserContextId = false;
|
||||||
|
+ let zenForcedWorkspaceId = undefined;
|
||||||
+ if (beforeRouteResult.isRouteFound && typeof userContextId !== "undefined") {
|
+ if (beforeRouteResult.isRouteFound && typeof userContextId !== "undefined") {
|
||||||
+ userContextId = beforeRouteResult.userContextId;
|
+ userContextId = beforeRouteResult.userContextId;
|
||||||
+ hasZenDefaultUserContextId = true;
|
+ hasZenDefaultUserContextId = true;
|
||||||
+ } else if (typeof gZenWorkspaces !== "undefined" && !_forZenEmptyTab) {
|
+ } else if (typeof gZenWorkspaces !== "undefined" && !_forZenEmptyTab) {
|
||||||
+ [userContextId, hasZenDefaultUserContextId] = gZenWorkspaces.getContextIdIfNeeded(userContextId, fromExternal, triggeringPrincipal);
|
+ [userContextId, hasZenDefaultUserContextId, zenForcedWorkspaceId] = gZenWorkspaces.getContextIdIfNeeded(userContextId, fromExternal, triggeringPrincipal);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
if (!UserInteraction.running("browser.tabs.opening", window)) {
|
if (!UserInteraction.running("browser.tabs.opening", window)) {
|
||||||
@@ -310,7 +311,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
// If we're opening a foreground tab, set the owner by default.
|
// If we're opening a foreground tab, set the owner by default.
|
||||||
ownerTab ??= inBackground ? null : this.selectedTab;
|
ownerTab ??= inBackground ? null : this.selectedTab;
|
||||||
|
|
||||||
@@ -3358,6 +3463,7 @@
|
@@ -3358,6 +3464,7 @@
|
||||||
if (this.selectedTab.owner) {
|
if (this.selectedTab.owner) {
|
||||||
this.selectedTab.owner = null;
|
this.selectedTab.owner = null;
|
||||||
}
|
}
|
||||||
@@ -318,7 +319,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
|
|
||||||
// Find the tab that opened this one, if any. This is used for
|
// Find the tab that opened this one, if any. This is used for
|
||||||
// determining positioning, and inherited attributes such as the
|
// determining positioning, and inherited attributes such as the
|
||||||
@@ -3410,6 +3516,18 @@
|
@@ -3410,6 +3517,22 @@
|
||||||
noInitialLabel,
|
noInitialLabel,
|
||||||
skipBackgroundNotify,
|
skipBackgroundNotify,
|
||||||
});
|
});
|
||||||
@@ -327,6 +328,10 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
+ }
|
+ }
|
||||||
+ if (zenWorkspaceId) {
|
+ if (zenWorkspaceId) {
|
||||||
+ t.setAttribute("zen-workspace-id", zenWorkspaceId);
|
+ t.setAttribute("zen-workspace-id", zenWorkspaceId);
|
||||||
|
+ t.setAttribute("change-workspace", "")
|
||||||
|
+ } else if (zenForcedWorkspaceId !== undefined) {
|
||||||
|
+ t.setAttribute("zen-workspace-id", zenForcedWorkspaceId);
|
||||||
|
+ t.setAttribute("change-workspace", "")
|
||||||
+ }
|
+ }
|
||||||
+ if (_forZenEmptyTab) {
|
+ if (_forZenEmptyTab) {
|
||||||
+ t.setAttribute("zen-empty-tab", "true");
|
+ t.setAttribute("zen-empty-tab", "true");
|
||||||
@@ -337,7 +342,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
if (insertTab) {
|
if (insertTab) {
|
||||||
// Insert the tab into the tab container in the correct position.
|
// Insert the tab into the tab container in the correct position.
|
||||||
this.#insertTabAtIndex(t, {
|
this.#insertTabAtIndex(t, {
|
||||||
@@ -3418,6 +3536,7 @@
|
@@ -3418,6 +3541,7 @@
|
||||||
ownerTab,
|
ownerTab,
|
||||||
openerTab,
|
openerTab,
|
||||||
pinned,
|
pinned,
|
||||||
@@ -345,7 +350,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
bulkOrderedOpen,
|
bulkOrderedOpen,
|
||||||
tabGroup: tabGroup ?? openerTab?.group,
|
tabGroup: tabGroup ?? openerTab?.group,
|
||||||
});
|
});
|
||||||
@@ -3436,6 +3555,7 @@
|
@@ -3436,6 +3560,7 @@
|
||||||
openWindowInfo,
|
openWindowInfo,
|
||||||
skipLoad,
|
skipLoad,
|
||||||
triggeringRemoteType,
|
triggeringRemoteType,
|
||||||
@@ -353,7 +358,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
if (focusUrlBar) {
|
if (focusUrlBar) {
|
||||||
@@ -3560,6 +3680,12 @@
|
@@ -3560,6 +3685,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,7 +371,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
// Additionally send pinned tab events
|
// Additionally send pinned tab events
|
||||||
if (pinned) {
|
if (pinned) {
|
||||||
this.#notifyPinnedStatus(t);
|
this.#notifyPinnedStatus(t);
|
||||||
@@ -3570,6 +3696,15 @@
|
@@ -3570,6 +3701,15 @@
|
||||||
if (!inBackground) {
|
if (!inBackground) {
|
||||||
this.selectedTab = t;
|
this.selectedTab = t;
|
||||||
}
|
}
|
||||||
@@ -382,7 +387,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3802,6 +3937,7 @@
|
@@ -3802,6 +3942,7 @@
|
||||||
isAdoptingGroup = false,
|
isAdoptingGroup = false,
|
||||||
isUserTriggered = false,
|
isUserTriggered = false,
|
||||||
telemetryUserCreateSource = "unknown",
|
telemetryUserCreateSource = "unknown",
|
||||||
@@ -390,7 +395,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
} = {}
|
} = {}
|
||||||
) {
|
) {
|
||||||
if (
|
if (
|
||||||
@@ -3812,9 +3948,6 @@
|
@@ -3812,9 +3953,6 @@
|
||||||
!this.isSplitViewWrapper(tabOrSplitView)
|
!this.isSplitViewWrapper(tabOrSplitView)
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
@@ -400,7 +405,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!color) {
|
if (!color) {
|
||||||
@@ -3835,9 +3968,14 @@
|
@@ -3835,9 +3973,14 @@
|
||||||
label,
|
label,
|
||||||
isAdoptingGroup
|
isAdoptingGroup
|
||||||
);
|
);
|
||||||
@@ -417,7 +422,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
);
|
);
|
||||||
group.addTabs(tabsAndSplitViews);
|
group.addTabs(tabsAndSplitViews);
|
||||||
|
|
||||||
@@ -3958,7 +4096,7 @@
|
@@ -3958,7 +4101,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
this.#handleTabMove(tab, () =>
|
this.#handleTabMove(tab, () =>
|
||||||
@@ -426,7 +431,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4044,6 +4182,7 @@
|
@@ -4044,6 +4187,7 @@
|
||||||
color: group.color,
|
color: group.color,
|
||||||
insertBefore: newTabs[0],
|
insertBefore: newTabs[0],
|
||||||
isAdoptingGroup: true,
|
isAdoptingGroup: true,
|
||||||
@@ -434,7 +439,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4254,6 +4393,7 @@
|
@@ -4254,6 +4398,7 @@
|
||||||
openWindowInfo,
|
openWindowInfo,
|
||||||
skipLoad,
|
skipLoad,
|
||||||
triggeringRemoteType,
|
triggeringRemoteType,
|
||||||
@@ -442,7 +447,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
// If we don't have a preferred remote type (or it is `NOT_REMOTE`), and
|
// If we don't have a preferred remote type (or it is `NOT_REMOTE`), and
|
||||||
@@ -4323,6 +4463,7 @@
|
@@ -4323,6 +4468,7 @@
|
||||||
openWindowInfo,
|
openWindowInfo,
|
||||||
name,
|
name,
|
||||||
skipLoad,
|
skipLoad,
|
||||||
@@ -450,7 +455,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4536,9 +4677,9 @@
|
@@ -4536,9 +4682,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a new tab if needed.
|
// Add a new tab if needed.
|
||||||
@@ -462,7 +467,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
|
|
||||||
let url = "about:blank";
|
let url = "about:blank";
|
||||||
if (tabData.entries?.length) {
|
if (tabData.entries?.length) {
|
||||||
@@ -4575,8 +4716,10 @@
|
@@ -4575,8 +4721,10 @@
|
||||||
insertTab: false,
|
insertTab: false,
|
||||||
skipLoad: true,
|
skipLoad: true,
|
||||||
preferredRemoteType,
|
preferredRemoteType,
|
||||||
@@ -474,7 +479,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
if (select) {
|
if (select) {
|
||||||
tabToSelect = tab;
|
tabToSelect = tab;
|
||||||
}
|
}
|
||||||
@@ -4598,7 +4741,8 @@
|
@@ -4598,7 +4746,8 @@
|
||||||
this.pinTab(tab);
|
this.pinTab(tab);
|
||||||
// Then ensure all the tab open/pinning information is sent.
|
// Then ensure all the tab open/pinning information is sent.
|
||||||
this._fireTabOpen(tab, {});
|
this._fireTabOpen(tab, {});
|
||||||
@@ -484,7 +489,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
let { groupId } = tabData;
|
let { groupId } = tabData;
|
||||||
const tabGroup = tabGroupWorkingData.get(groupId);
|
const tabGroup = tabGroupWorkingData.get(groupId);
|
||||||
// if a tab refers to a tab group we don't know, skip any group
|
// if a tab refers to a tab group we don't know, skip any group
|
||||||
@@ -4618,7 +4762,10 @@
|
@@ -4618,7 +4767,10 @@
|
||||||
tabGroup.stateData.id,
|
tabGroup.stateData.id,
|
||||||
tabGroup.stateData.color,
|
tabGroup.stateData.color,
|
||||||
tabGroup.stateData.collapsed,
|
tabGroup.stateData.collapsed,
|
||||||
@@ -496,7 +501,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
);
|
);
|
||||||
tabsFragment.appendChild(tabGroup.node);
|
tabsFragment.appendChild(tabGroup.node);
|
||||||
}
|
}
|
||||||
@@ -4673,9 +4820,21 @@
|
@@ -4673,9 +4825,21 @@
|
||||||
// to remove the old selected tab.
|
// to remove the old selected tab.
|
||||||
if (tabToSelect) {
|
if (tabToSelect) {
|
||||||
let leftoverTab = this.selectedTab;
|
let leftoverTab = this.selectedTab;
|
||||||
@@ -518,12 +523,15 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
|
|
||||||
if (tabs.length > 1 || !tabs[0].selected) {
|
if (tabs.length > 1 || !tabs[0].selected) {
|
||||||
this._updateTabsAfterInsert();
|
this._updateTabsAfterInsert();
|
||||||
@@ -4866,11 +5025,14 @@
|
@@ -4866,11 +5030,17 @@
|
||||||
if (ownerTab) {
|
if (ownerTab) {
|
||||||
tab.owner = ownerTab;
|
tab.owner = ownerTab;
|
||||||
}
|
}
|
||||||
+ if ((!tab.pinned && tabGroup?.isZenFolder && !Services.prefs.getBoolPref('zen.folders.owned-tabs-in-folder')) || (tabGroup && tabGroup.hasAttribute("split-view-group"))) {
|
+ if ((!tab.pinned && tabGroup?.isZenFolder && !Services.prefs.getBoolPref('zen.folders.owned-tabs-in-folder')) || (tabGroup && tabGroup.hasAttribute("split-view-group"))) {
|
||||||
+ tabGroup = null;
|
+ tabGroup = null;
|
||||||
|
+ }
|
||||||
|
+ if (openerTab?.hasAttribute("zen-glance-tab")) {
|
||||||
|
+ openerTab = gZenGlanceManager.getTabOrGlanceParent(openerTab);
|
||||||
+ }
|
+ }
|
||||||
|
|
||||||
// Ensure we have an index if one was not provided.
|
// Ensure we have an index if one was not provided.
|
||||||
@@ -534,7 +542,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
if (
|
if (
|
||||||
!bulkOrderedOpen &&
|
!bulkOrderedOpen &&
|
||||||
((openerTab &&
|
((openerTab &&
|
||||||
@@ -4882,7 +5044,7 @@
|
@@ -4882,7 +5052,7 @@
|
||||||
let lastRelatedTab =
|
let lastRelatedTab =
|
||||||
openerTab && this._lastRelatedTabMap.get(openerTab);
|
openerTab && this._lastRelatedTabMap.get(openerTab);
|
||||||
let previousTab = lastRelatedTab || openerTab || this.selectedTab;
|
let previousTab = lastRelatedTab || openerTab || this.selectedTab;
|
||||||
@@ -543,7 +551,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
tabGroup = previousTab.group;
|
tabGroup = previousTab.group;
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
@@ -4898,7 +5060,7 @@
|
@@ -4898,7 +5068,7 @@
|
||||||
previousTab.splitview
|
previousTab.splitview
|
||||||
) + 1;
|
) + 1;
|
||||||
} else if (previousTab.visible) {
|
} else if (previousTab.visible) {
|
||||||
@@ -552,7 +560,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
} else if (previousTab == FirefoxViewHandler.tab) {
|
} else if (previousTab == FirefoxViewHandler.tab) {
|
||||||
elementIndex = 0;
|
elementIndex = 0;
|
||||||
}
|
}
|
||||||
@@ -4926,14 +5088,14 @@
|
@@ -4926,14 +5096,14 @@
|
||||||
}
|
}
|
||||||
// Ensure index is within bounds.
|
// Ensure index is within bounds.
|
||||||
if (tab.pinned) {
|
if (tab.pinned) {
|
||||||
@@ -571,7 +579,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
|
|
||||||
if (pinned && !itemAfter?.pinned) {
|
if (pinned && !itemAfter?.pinned) {
|
||||||
itemAfter = null;
|
itemAfter = null;
|
||||||
@@ -4950,7 +5112,7 @@
|
@@ -4950,7 +5120,7 @@
|
||||||
|
|
||||||
this.tabContainer._invalidateCachedTabs();
|
this.tabContainer._invalidateCachedTabs();
|
||||||
|
|
||||||
@@ -580,7 +588,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
if (
|
if (
|
||||||
(this.isTab(itemAfter) && itemAfter.group == tabGroup) ||
|
(this.isTab(itemAfter) && itemAfter.group == tabGroup) ||
|
||||||
this.isSplitViewWrapper(itemAfter)
|
this.isSplitViewWrapper(itemAfter)
|
||||||
@@ -4981,7 +5143,11 @@
|
@@ -4981,7 +5151,11 @@
|
||||||
const tabContainer = pinned
|
const tabContainer = pinned
|
||||||
? this.tabContainer.pinnedTabsContainer
|
? this.tabContainer.pinnedTabsContainer
|
||||||
: this.tabContainer;
|
: this.tabContainer;
|
||||||
@@ -592,7 +600,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (tab.group?.collapsed) {
|
if (tab.group?.collapsed) {
|
||||||
@@ -4996,6 +5162,7 @@
|
@@ -4996,6 +5170,7 @@
|
||||||
if (pinned) {
|
if (pinned) {
|
||||||
this._updateTabBarForPinnedTabs();
|
this._updateTabBarForPinnedTabs();
|
||||||
}
|
}
|
||||||
@@ -600,7 +608,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
|
|
||||||
TabBarVisibility.update();
|
TabBarVisibility.update();
|
||||||
}
|
}
|
||||||
@@ -5544,6 +5711,7 @@
|
@@ -5544,6 +5719,7 @@
|
||||||
telemetrySource,
|
telemetrySource,
|
||||||
} = {}
|
} = {}
|
||||||
) {
|
) {
|
||||||
@@ -608,7 +616,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
// When 'closeWindowWithLastTab' pref is enabled, closing all tabs
|
// When 'closeWindowWithLastTab' pref is enabled, closing all tabs
|
||||||
// can be considered equivalent to closing the window.
|
// can be considered equivalent to closing the window.
|
||||||
if (
|
if (
|
||||||
@@ -5633,6 +5801,7 @@
|
@@ -5633,6 +5809,7 @@
|
||||||
if (lastToClose) {
|
if (lastToClose) {
|
||||||
this.removeTab(lastToClose, aParams);
|
this.removeTab(lastToClose, aParams);
|
||||||
}
|
}
|
||||||
@@ -616,7 +624,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
@@ -5678,6 +5847,14 @@
|
@@ -5678,6 +5855,14 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -631,7 +639,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
let isVisibleTab = aTab.visible;
|
let isVisibleTab = aTab.visible;
|
||||||
// We have to sample the tab width now, since _beginRemoveTab might
|
// We have to sample the tab width now, since _beginRemoveTab might
|
||||||
// end up modifying the DOM in such a way that aTab gets a new
|
// end up modifying the DOM in such a way that aTab gets a new
|
||||||
@@ -5685,6 +5862,9 @@
|
@@ -5685,6 +5870,9 @@
|
||||||
// state).
|
// state).
|
||||||
let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width;
|
let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width;
|
||||||
let isLastTab = this.#isLastTabInWindow(aTab);
|
let isLastTab = this.#isLastTabInWindow(aTab);
|
||||||
@@ -641,7 +649,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
if (
|
if (
|
||||||
!this._beginRemoveTab(aTab, {
|
!this._beginRemoveTab(aTab, {
|
||||||
closeWindowFastpath: true,
|
closeWindowFastpath: true,
|
||||||
@@ -5696,13 +5876,14 @@
|
@@ -5696,13 +5884,14 @@
|
||||||
telemetrySource,
|
telemetrySource,
|
||||||
})
|
})
|
||||||
) {
|
) {
|
||||||
@@ -657,7 +665,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
let lockTabSizing =
|
let lockTabSizing =
|
||||||
!this.tabContainer.verticalMode &&
|
!this.tabContainer.verticalMode &&
|
||||||
!aTab.pinned &&
|
!aTab.pinned &&
|
||||||
@@ -5733,7 +5914,13 @@
|
@@ -5733,7 +5922,13 @@
|
||||||
// We're not animating, so we can cancel the animation stopwatch.
|
// We're not animating, so we can cancel the animation stopwatch.
|
||||||
Glean.browserTabclose.timeAnim.cancel(aTab._closeTimeAnimTimerId);
|
Glean.browserTabclose.timeAnim.cancel(aTab._closeTimeAnimTimerId);
|
||||||
aTab._closeTimeAnimTimerId = null;
|
aTab._closeTimeAnimTimerId = null;
|
||||||
@@ -672,7 +680,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5867,7 +6054,7 @@
|
@@ -5867,7 +6062,7 @@
|
||||||
closeWindowWithLastTab != null
|
closeWindowWithLastTab != null
|
||||||
? closeWindowWithLastTab
|
? closeWindowWithLastTab
|
||||||
: !window.toolbar.visible ||
|
: !window.toolbar.visible ||
|
||||||
@@ -681,7 +689,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
|
|
||||||
if (closeWindow) {
|
if (closeWindow) {
|
||||||
// We've already called beforeunload on all the relevant tabs if we get here,
|
// We've already called beforeunload on all the relevant tabs if we get here,
|
||||||
@@ -5891,6 +6078,7 @@
|
@@ -5891,6 +6086,7 @@
|
||||||
|
|
||||||
newTab = true;
|
newTab = true;
|
||||||
}
|
}
|
||||||
@@ -689,7 +697,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
aTab._endRemoveArgs = [closeWindow, newTab];
|
aTab._endRemoveArgs = [closeWindow, newTab];
|
||||||
|
|
||||||
// swapBrowsersAndCloseOther will take care of closing the window without animation.
|
// swapBrowsersAndCloseOther will take care of closing the window without animation.
|
||||||
@@ -5931,13 +6119,7 @@
|
@@ -5931,13 +6127,7 @@
|
||||||
aTab._mouseleave();
|
aTab._mouseleave();
|
||||||
|
|
||||||
if (newTab) {
|
if (newTab) {
|
||||||
@@ -704,7 +712,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
} else {
|
} else {
|
||||||
TabBarVisibility.update();
|
TabBarVisibility.update();
|
||||||
}
|
}
|
||||||
@@ -6070,6 +6252,7 @@
|
@@ -6070,6 +6260,7 @@
|
||||||
this.tabs[i]._tPos = i;
|
this.tabs[i]._tPos = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -712,7 +720,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
if (!this._windowIsClosing) {
|
if (!this._windowIsClosing) {
|
||||||
// update tab close buttons state
|
// update tab close buttons state
|
||||||
this.tabContainer._updateCloseButtons();
|
this.tabContainer._updateCloseButtons();
|
||||||
@@ -6255,6 +6438,7 @@
|
@@ -6255,6 +6446,7 @@
|
||||||
memory_after: await getTotalMemoryUsage(),
|
memory_after: await getTotalMemoryUsage(),
|
||||||
time_to_unload_in_ms: timeElapsed,
|
time_to_unload_in_ms: timeElapsed,
|
||||||
});
|
});
|
||||||
@@ -720,7 +728,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -6300,6 +6484,7 @@
|
@@ -6300,6 +6492,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
let excludeTabs = new Set(aExcludeTabs);
|
let excludeTabs = new Set(aExcludeTabs);
|
||||||
@@ -728,7 +736,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
|
|
||||||
// If this tab has a successor, it should be selectable, since
|
// If this tab has a successor, it should be selectable, since
|
||||||
// hiding or closing a tab removes that tab as a successor.
|
// hiding or closing a tab removes that tab as a successor.
|
||||||
@@ -6312,15 +6497,22 @@
|
@@ -6312,15 +6505,22 @@
|
||||||
!excludeTabs.has(aTab.owner) &&
|
!excludeTabs.has(aTab.owner) &&
|
||||||
Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose")
|
Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose")
|
||||||
) {
|
) {
|
||||||
@@ -753,7 +761,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
let tab = this.tabContainer.findNextTab(aTab, {
|
let tab = this.tabContainer.findNextTab(aTab, {
|
||||||
direction: 1,
|
direction: 1,
|
||||||
filter: _tab => remainingTabs.includes(_tab),
|
filter: _tab => remainingTabs.includes(_tab),
|
||||||
@@ -6334,7 +6526,7 @@
|
@@ -6334,7 +6534,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tab) {
|
if (tab) {
|
||||||
@@ -762,7 +770,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If no qualifying visible tab was found, see if there is a tab in
|
// If no qualifying visible tab was found, see if there is a tab in
|
||||||
@@ -6355,7 +6547,7 @@
|
@@ -6355,7 +6555,7 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -771,7 +779,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
}
|
}
|
||||||
|
|
||||||
_blurTab(aTab) {
|
_blurTab(aTab) {
|
||||||
@@ -6366,7 +6558,7 @@
|
@@ -6366,7 +6566,7 @@
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
* False if swapping isn't permitted, true otherwise.
|
* False if swapping isn't permitted, true otherwise.
|
||||||
*/
|
*/
|
||||||
@@ -780,7 +788,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
// Do not allow transfering a private tab to a non-private window
|
// Do not allow transfering a private tab to a non-private window
|
||||||
// and vice versa.
|
// and vice versa.
|
||||||
if (
|
if (
|
||||||
@@ -6420,6 +6612,7 @@
|
@@ -6420,6 +6620,7 @@
|
||||||
// fire the beforeunload event in the process. Close the other
|
// fire the beforeunload event in the process. Close the other
|
||||||
// window if this was its last tab.
|
// window if this was its last tab.
|
||||||
if (
|
if (
|
||||||
@@ -788,7 +796,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
!remoteBrowser._beginRemoveTab(aOtherTab, {
|
!remoteBrowser._beginRemoveTab(aOtherTab, {
|
||||||
adoptedByTab: aOurTab,
|
adoptedByTab: aOurTab,
|
||||||
closeWindowWithLastTab: true,
|
closeWindowWithLastTab: true,
|
||||||
@@ -6431,7 +6624,7 @@
|
@@ -6431,7 +6632,7 @@
|
||||||
// If this is the last tab of the window, hide the window
|
// If this is the last tab of the window, hide the window
|
||||||
// immediately without animation before the docshell swap, to avoid
|
// immediately without animation before the docshell swap, to avoid
|
||||||
// about:blank being painted.
|
// about:blank being painted.
|
||||||
@@ -797,7 +805,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
if (closeWindow) {
|
if (closeWindow) {
|
||||||
let win = aOtherTab.documentGlobal;
|
let win = aOtherTab.documentGlobal;
|
||||||
win.windowUtils.suppressAnimation(true);
|
win.windowUtils.suppressAnimation(true);
|
||||||
@@ -6565,11 +6758,13 @@
|
@@ -6565,11 +6766,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// Finish tearing down the tab that's going away.
|
// Finish tearing down the tab that's going away.
|
||||||
@@ -811,7 +819,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
|
|
||||||
this.setTabTitle(aOurTab);
|
this.setTabTitle(aOurTab);
|
||||||
|
|
||||||
@@ -6771,10 +6966,10 @@
|
@@ -6771,10 +6974,10 @@
|
||||||
SessionStore.deleteCustomTabValue(aTab, "hiddenBy");
|
SessionStore.deleteCustomTabValue(aTab, "hiddenBy");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -824,7 +832,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
aTab.selected ||
|
aTab.selected ||
|
||||||
aTab.closing ||
|
aTab.closing ||
|
||||||
// Tabs that are sharing the screen, microphone or camera cannot be hidden.
|
// Tabs that are sharing the screen, microphone or camera cannot be hidden.
|
||||||
@@ -6834,7 +7029,8 @@
|
@@ -6834,7 +7037,8 @@
|
||||||
* @param {object} [aOptions={}]
|
* @param {object} [aOptions={}]
|
||||||
* Key-value pairs that will be serialized into the features string.
|
* Key-value pairs that will be serialized into the features string.
|
||||||
*/
|
*/
|
||||||
@@ -834,7 +842,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
if (this.tabs.length == 1) {
|
if (this.tabs.length == 1) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -6851,7 +7047,7 @@
|
@@ -6851,7 +7055,7 @@
|
||||||
// tell a new window to take the "dropped" tab
|
// tell a new window to take the "dropped" tab
|
||||||
let args = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
|
let args = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
|
||||||
args.appendElement(aTab.splitview ?? aTab);
|
args.appendElement(aTab.splitview ?? aTab);
|
||||||
@@ -843,7 +851,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
private: PrivateBrowsingUtils.isWindowPrivate(window),
|
private: PrivateBrowsingUtils.isWindowPrivate(window),
|
||||||
features: Object.entries(aOptions)
|
features: Object.entries(aOptions)
|
||||||
.map(([key, value]) => `${key}=${value}`)
|
.map(([key, value]) => `${key}=${value}`)
|
||||||
@@ -6859,6 +7055,8 @@
|
@@ -6859,6 +7063,8 @@
|
||||||
openerWindow: window,
|
openerWindow: window,
|
||||||
args,
|
args,
|
||||||
});
|
});
|
||||||
@@ -852,7 +860,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -6971,7 +7169,7 @@
|
@@ -6971,7 +7177,7 @@
|
||||||
* `true` if element is a `<tab-group>`
|
* `true` if element is a `<tab-group>`
|
||||||
*/
|
*/
|
||||||
isTabGroup(element) {
|
isTabGroup(element) {
|
||||||
@@ -861,7 +869,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -7056,8 +7254,8 @@
|
@@ -7056,8 +7262,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't allow mixing pinned and unpinned tabs.
|
// Don't allow mixing pinned and unpinned tabs.
|
||||||
@@ -872,7 +880,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
} else {
|
} else {
|
||||||
tabIndex = Math.max(tabIndex, this.pinnedTabCount);
|
tabIndex = Math.max(tabIndex, this.pinnedTabCount);
|
||||||
}
|
}
|
||||||
@@ -7103,8 +7301,8 @@
|
@@ -7103,8 +7309,8 @@
|
||||||
this.#handleTabMove(
|
this.#handleTabMove(
|
||||||
element,
|
element,
|
||||||
() => {
|
() => {
|
||||||
@@ -883,7 +891,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
neighbor = neighbor.group;
|
neighbor = neighbor.group;
|
||||||
}
|
}
|
||||||
if (neighbor?.splitview) {
|
if (neighbor?.splitview) {
|
||||||
@@ -7115,6 +7313,12 @@
|
@@ -7115,6 +7321,12 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -896,7 +904,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
|
|
||||||
if (movingForwards && neighbor) {
|
if (movingForwards && neighbor) {
|
||||||
neighbor.after(element);
|
neighbor.after(element);
|
||||||
@@ -7173,23 +7377,31 @@
|
@@ -7173,23 +7385,31 @@
|
||||||
#moveTabNextTo(element, targetElement, moveBefore = false, metricsContext) {
|
#moveTabNextTo(element, targetElement, moveBefore = false, metricsContext) {
|
||||||
if (this.isTabGroupLabel(targetElement)) {
|
if (this.isTabGroupLabel(targetElement)) {
|
||||||
targetElement = targetElement.group;
|
targetElement = targetElement.group;
|
||||||
@@ -934,7 +942,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
} else if (!element.pinned && targetElement && targetElement.pinned) {
|
} else if (!element.pinned && targetElement && targetElement.pinned) {
|
||||||
// If the caller asks to move an unpinned element next to a pinned
|
// If the caller asks to move an unpinned element next to a pinned
|
||||||
// tab, move the unpinned element to be the first unpinned element
|
// tab, move the unpinned element to be the first unpinned element
|
||||||
@@ -7202,12 +7414,35 @@
|
@@ -7202,12 +7422,35 @@
|
||||||
// move the tab group right before the first unpinned tab.
|
// move the tab group right before the first unpinned tab.
|
||||||
// 4. Moving a tab group and the first unpinned tab is grouped:
|
// 4. Moving a tab group and the first unpinned tab is grouped:
|
||||||
// move the tab group right before the first unpinned tab's tab group.
|
// move the tab group right before the first unpinned tab's tab group.
|
||||||
@@ -971,7 +979,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
|
|
||||||
// We want to include the splitview wrapper if it's the targetElement, but
|
// We want to include the splitview wrapper if it's the targetElement, but
|
||||||
// not in the case where we want to reverse tabs within the same splitview.
|
// not in the case where we want to reverse tabs within the same splitview.
|
||||||
@@ -7216,6 +7451,7 @@
|
@@ -7216,6 +7459,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
let getContainer = () =>
|
let getContainer = () =>
|
||||||
@@ -979,7 +987,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
element.pinned
|
element.pinned
|
||||||
? this.tabContainer.pinnedTabsContainer
|
? this.tabContainer.pinnedTabsContainer
|
||||||
: this.tabContainer;
|
: this.tabContainer;
|
||||||
@@ -7224,11 +7460,15 @@
|
@@ -7224,11 +7468,15 @@
|
||||||
element,
|
element,
|
||||||
() => {
|
() => {
|
||||||
if (moveBefore) {
|
if (moveBefore) {
|
||||||
@@ -996,7 +1004,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
metricsContext
|
metricsContext
|
||||||
@@ -7302,11 +7542,15 @@
|
@@ -7302,11 +7550,15 @@
|
||||||
* @param {TabMetricsContext} [metricsContext]
|
* @param {TabMetricsContext} [metricsContext]
|
||||||
*/
|
*/
|
||||||
moveTabToExistingGroup(aTab, aGroup, metricsContext) {
|
moveTabToExistingGroup(aTab, aGroup, metricsContext) {
|
||||||
@@ -1015,7 +1023,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
}
|
}
|
||||||
if (aTab.group && aTab.group.id === aGroup.id) {
|
if (aTab.group && aTab.group.id === aGroup.id) {
|
||||||
return;
|
return;
|
||||||
@@ -7378,6 +7622,7 @@
|
@@ -7378,6 +7630,7 @@
|
||||||
|
|
||||||
let state = {
|
let state = {
|
||||||
tabIndex: tab._tPos,
|
tabIndex: tab._tPos,
|
||||||
@@ -1023,7 +1031,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
};
|
};
|
||||||
if (tab.visible) {
|
if (tab.visible) {
|
||||||
state.elementIndex = tab.elementIndex;
|
state.elementIndex = tab.elementIndex;
|
||||||
@@ -7409,7 +7654,7 @@
|
@@ -7409,7 +7662,7 @@
|
||||||
let changedSplitView =
|
let changedSplitView =
|
||||||
previousTabState.splitViewId != currentTabState.splitViewId;
|
previousTabState.splitViewId != currentTabState.splitViewId;
|
||||||
|
|
||||||
@@ -1032,7 +1040,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
tab.dispatchEvent(
|
tab.dispatchEvent(
|
||||||
new CustomEvent("TabMove", {
|
new CustomEvent("TabMove", {
|
||||||
bubbles: true,
|
bubbles: true,
|
||||||
@@ -7456,6 +7701,10 @@
|
@@ -7456,6 +7709,10 @@
|
||||||
|
|
||||||
moveActionCallback();
|
moveActionCallback();
|
||||||
|
|
||||||
@@ -1043,7 +1051,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
// Clear tabs cache after moving nodes because the order of tabs may have
|
// Clear tabs cache after moving nodes because the order of tabs may have
|
||||||
// changed.
|
// changed.
|
||||||
this.tabContainer._invalidateCachedTabs();
|
this.tabContainer._invalidateCachedTabs();
|
||||||
@@ -7506,7 +7755,22 @@
|
@@ -7506,7 +7763,22 @@
|
||||||
* @returns {object}
|
* @returns {object}
|
||||||
* The new tab in the current window, null if the tab couldn't be adopted.
|
* The new tab in the current window, null if the tab couldn't be adopted.
|
||||||
*/
|
*/
|
||||||
@@ -1067,7 +1075,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
// Swap the dropped tab with a new one we create and then close
|
// Swap the dropped tab with a new one we create and then close
|
||||||
// it in the other window (making it seem to have moved between
|
// it in the other window (making it seem to have moved between
|
||||||
// windows). We also ensure that the tab we create to swap into has
|
// windows). We also ensure that the tab we create to swap into has
|
||||||
@@ -7549,6 +7813,8 @@
|
@@ -7549,6 +7821,8 @@
|
||||||
}
|
}
|
||||||
params.skipLoad = true;
|
params.skipLoad = true;
|
||||||
let newTab = this.addWebTab("about:blank", params);
|
let newTab = this.addWebTab("about:blank", params);
|
||||||
@@ -1076,7 +1084,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
|
|
||||||
aTab.container.tabDragAndDrop.finishAnimateTabMove();
|
aTab.container.tabDragAndDrop.finishAnimateTabMove();
|
||||||
|
|
||||||
@@ -8259,7 +8525,7 @@
|
@@ -8259,7 +8533,7 @@
|
||||||
// preventDefault(). It will still raise the window if appropriate.
|
// preventDefault(). It will still raise the window if appropriate.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1085,7 +1093,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
window.focus();
|
window.focus();
|
||||||
aEvent.preventDefault();
|
aEvent.preventDefault();
|
||||||
}
|
}
|
||||||
@@ -8276,7 +8542,6 @@
|
@@ -8276,7 +8550,6 @@
|
||||||
|
|
||||||
on_TabGroupCollapse(aEvent) {
|
on_TabGroupCollapse(aEvent) {
|
||||||
aEvent.target.tabs.forEach(tab => {
|
aEvent.target.tabs.forEach(tab => {
|
||||||
@@ -1093,7 +1101,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8630,7 +8895,9 @@
|
@@ -8630,7 +8903,9 @@
|
||||||
|
|
||||||
let filter = this._tabFilters.get(tab);
|
let filter = this._tabFilters.get(tab);
|
||||||
if (filter) {
|
if (filter) {
|
||||||
@@ -1103,7 +1111,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
|
|
||||||
let listener = this._tabListeners.get(tab);
|
let listener = this._tabListeners.get(tab);
|
||||||
if (listener) {
|
if (listener) {
|
||||||
@@ -9435,6 +9702,7 @@
|
@@ -9435,6 +9710,7 @@
|
||||||
aWebProgress.isTopLevel
|
aWebProgress.isTopLevel
|
||||||
) {
|
) {
|
||||||
this.mTab.setAttribute("busy", "true");
|
this.mTab.setAttribute("busy", "true");
|
||||||
@@ -1111,7 +1119,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
gBrowser._tabAttrModified(this.mTab, ["busy"]);
|
gBrowser._tabAttrModified(this.mTab, ["busy"]);
|
||||||
this.mTab._notselectedsinceload = !this.mTab.selected;
|
this.mTab._notselectedsinceload = !this.mTab.selected;
|
||||||
}
|
}
|
||||||
@@ -9515,6 +9783,7 @@
|
@@ -9515,6 +9791,7 @@
|
||||||
// known defaults. Note we use the original URL since about:newtab
|
// known defaults. Note we use the original URL since about:newtab
|
||||||
// redirects to a prerendered page.
|
// redirects to a prerendered page.
|
||||||
const shouldRemoveFavicon =
|
const shouldRemoveFavicon =
|
||||||
@@ -1119,7 +1127,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
!this.mBrowser.mIconURL &&
|
!this.mBrowser.mIconURL &&
|
||||||
!ignoreBlank &&
|
!ignoreBlank &&
|
||||||
!(originalLocation.spec in FAVICON_DEFAULTS);
|
!(originalLocation.spec in FAVICON_DEFAULTS);
|
||||||
@@ -9689,13 +9958,6 @@
|
@@ -9689,13 +9966,6 @@
|
||||||
this.mBrowser.originalURI = aRequest.originalURI;
|
this.mBrowser.originalURI = aRequest.originalURI;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1133,7 +1141,7 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..99b3de9a7be5cd5fd73c0b9dbbe26565
|
|||||||
}
|
}
|
||||||
|
|
||||||
let userContextId = this.mBrowser.getAttribute("usercontextid") || 0;
|
let userContextId = this.mBrowser.getAttribute("usercontextid") || 0;
|
||||||
@@ -10587,7 +10849,8 @@ var TabContextMenu = {
|
@@ -10587,7 +10857,8 @@ var TabContextMenu = {
|
||||||
);
|
);
|
||||||
contextUnpinSelectedTabs.hidden =
|
contextUnpinSelectedTabs.hidden =
|
||||||
!this.contextTab.pinned || !this.multiselected;
|
!this.contextTab.pinned || !this.multiselected;
|
||||||
|
|||||||
@@ -1,167 +0,0 @@
|
|||||||
diff --git a/gfx/webrender_bindings/WebRenderAPI.cpp b/gfx/webrender_bindings/WebRenderAPI.cpp
|
|
||||||
--- a/gfx/webrender_bindings/WebRenderAPI.cpp
|
|
||||||
+++ b/gfx/webrender_bindings/WebRenderAPI.cpp
|
|
||||||
@@ -298,11 +298,13 @@
|
|
||||||
panic_on_gl_error, picTileWidth, picTileHeight,
|
|
||||||
gfx::gfxVars::WebRenderRequiresHardwareDriver(),
|
|
||||||
StaticPrefs::gfx_webrender_low_quality_pinch_zoom_AtStartup(),
|
|
||||||
StaticPrefs::gfx_webrender_max_shared_surface_size_AtStartup(),
|
|
||||||
StaticPrefs::gfx_webrender_enable_subpixel_aa_AtStartup(),
|
|
||||||
- compositor->ShouldUseLayerCompositor())) {
|
|
||||||
+ compositor->ShouldUseLayerCompositor(),
|
|
||||||
+ StaticPrefs::
|
|
||||||
+ gfx_webrender_opaque_backdrop_fallback_AtStartup())) {
|
|
||||||
// wr_window_new puts a message into gfxCriticalNote if it returns
|
|
||||||
// false
|
|
||||||
MOZ_ASSERT(errorMessage);
|
|
||||||
error.AssignASCII(errorMessage);
|
|
||||||
wr_api_free_error_msg(errorMessage);
|
|
||||||
diff --git a/gfx/webrender_bindings/src/bindings.rs b/gfx/webrender_bindings/src/bindings.rs
|
|
||||||
--- a/gfx/webrender_bindings/src/bindings.rs
|
|
||||||
+++ b/gfx/webrender_bindings/src/bindings.rs
|
|
||||||
@@ -1998,10 +1998,11 @@
|
|
||||||
reject_software_rasterizer: bool,
|
|
||||||
low_quality_pinch_zoom: bool,
|
|
||||||
max_shared_surface_size: i32,
|
|
||||||
enable_subpixel_aa: bool,
|
|
||||||
use_layer_compositor: bool,
|
|
||||||
+ opaque_backdrop_fallback: bool,
|
|
||||||
) -> bool {
|
|
||||||
assert!(unsafe { is_in_render_thread() });
|
|
||||||
|
|
||||||
// Ensure the WR profiler callbacks are hooked up to the Gecko profiler.
|
|
||||||
set_profiler_hooks(Some(&PROFILER_HOOKS));
|
|
||||||
@@ -2164,10 +2165,11 @@
|
|
||||||
texture_cache_config,
|
|
||||||
reject_software_rasterizer,
|
|
||||||
low_quality_pinch_zoom,
|
|
||||||
max_shared_surface_size,
|
|
||||||
enable_dithering,
|
|
||||||
+ opaque_backdrop_fallback,
|
|
||||||
..Default::default()
|
|
||||||
};
|
|
||||||
|
|
||||||
let window_size = DeviceIntSize::new(window_width, window_height);
|
|
||||||
let notifier = Box::new(CppNotifier { window_id });
|
|
||||||
diff --git a/gfx/wr/webrender/src/device/gl.rs b/gfx/wr/webrender/src/device/gl.rs
|
|
||||||
--- a/gfx/wr/webrender/src/device/gl.rs
|
|
||||||
+++ b/gfx/wr/webrender/src/device/gl.rs
|
|
||||||
@@ -3982,10 +3982,14 @@
|
|
||||||
|
|
||||||
pub fn disable_color_write(&self) {
|
|
||||||
self.gl.color_mask(false, false, false, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ pub fn set_color_mask(&self, r: bool, g: bool, b: bool, a: bool) {
|
|
||||||
+ self.gl.color_mask(r, g, b, a);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
pub fn set_blend(&mut self, enable: bool) {
|
|
||||||
if enable {
|
|
||||||
self.gl.enable(gl::BLEND);
|
|
||||||
} else {
|
|
||||||
self.gl.disable(gl::BLEND);
|
|
||||||
diff --git a/gfx/wr/webrender/src/renderer/init.rs b/gfx/wr/webrender/src/renderer/init.rs
|
|
||||||
--- a/gfx/wr/webrender/src/renderer/init.rs
|
|
||||||
+++ b/gfx/wr/webrender/src/renderer/init.rs
|
|
||||||
@@ -204,6 +204,8 @@
|
|
||||||
pub low_quality_pinch_zoom: bool,
|
|
||||||
pub max_shared_surface_size: i32,
|
|
||||||
/// If true, open a debug socket to listen for remote debugger.
|
|
||||||
/// Relies on `debugger` cargo feature being enabled.
|
|
||||||
pub enable_debugger: bool,
|
|
||||||
+ /// See explanation of `gfx.webrender.opaque-backdrop-fallback`.
|
|
||||||
+ pub opaque_backdrop_fallback: bool,
|
|
||||||
}
|
|
||||||
@@ -277,9 +279,10 @@
|
|
||||||
enable_instancing: true,
|
|
||||||
reject_software_rasterizer: false,
|
|
||||||
low_quality_pinch_zoom: false,
|
|
||||||
max_shared_surface_size: 2048,
|
|
||||||
enable_debugger: true,
|
|
||||||
+ opaque_backdrop_fallback: false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -802,10 +805,11 @@
|
|
||||||
allocated_native_surfaces: FastHashSet::default(),
|
|
||||||
debug_overlay_state: DebugOverlayState::new(),
|
|
||||||
buffer_damage_tracker: BufferDamageTracker::default(),
|
|
||||||
max_primitive_instance_count,
|
|
||||||
enable_instancing: options.enable_instancing,
|
|
||||||
+ opaque_backdrop_fallback: options.opaque_backdrop_fallback,
|
|
||||||
consecutive_oom_frames: 0,
|
|
||||||
target_frame_publish_id: None,
|
|
||||||
pending_result_msg: None,
|
|
||||||
layer_compositor_frame_state_in_prev_frame: None,
|
|
||||||
external_composite_debug_items: Vec::new(),
|
|
||||||
diff --git a/gfx/wr/webrender/src/renderer/mod.rs b/gfx/wr/webrender/src/renderer/mod.rs
|
|
||||||
--- a/gfx/wr/webrender/src/renderer/mod.rs
|
|
||||||
+++ b/gfx/wr/webrender/src/renderer/mod.rs
|
|
||||||
@@ -867,10 +867,12 @@
|
|
||||||
buffer_damage_tracker: BufferDamageTracker,
|
|
||||||
|
|
||||||
max_primitive_instance_count: usize,
|
|
||||||
enable_instancing: bool,
|
|
||||||
|
|
||||||
+ opaque_backdrop_fallback: bool,
|
|
||||||
+
|
|
||||||
/// Count consecutive oom frames to detectif we are stuck unable to render
|
|
||||||
/// in a loop.
|
|
||||||
consecutive_oom_frames: u32,
|
|
||||||
|
|
||||||
/// update() defers processing of ResultMsg, if frame_publish_id of
|
|
||||||
@@ -2787,18 +2789,29 @@
|
|
||||||
let read_target = ReadTarget::from_texture(cache_texture);
|
|
||||||
|
|
||||||
// Should always be drawing to picture cache tiles or off-screen surface!
|
|
||||||
debug_assert!(!draw_target.is_default());
|
|
||||||
let device_to_framebuffer = Scale::new(1i32);
|
|
||||||
+ let dest_fb_rect = dest * device_to_framebuffer;
|
|
||||||
|
|
||||||
self.device.blit_render_target(
|
|
||||||
read_target,
|
|
||||||
src * device_to_framebuffer,
|
|
||||||
draw_target,
|
|
||||||
- dest * device_to_framebuffer,
|
|
||||||
+ dest_fb_rect,
|
|
||||||
TextureFilter::Linear,
|
|
||||||
);
|
|
||||||
+
|
|
||||||
+ if self.opaque_backdrop_fallback {
|
|
||||||
+ self.device.set_color_mask(false, false, false, true);
|
|
||||||
+ self.device.clear_target(
|
|
||||||
+ Some([0.0, 0.0, 0.0, 1.0]),
|
|
||||||
+ None,
|
|
||||||
+ Some(dest_fb_rect),
|
|
||||||
+ );
|
|
||||||
+ self.device.set_color_mask(true, true, true, true);
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn draw_picture_cache_target(
|
|
||||||
diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml
|
|
||||||
--- a/modules/libpref/init/StaticPrefList.yaml
|
|
||||||
+++ b/modules/libpref/init/StaticPrefList.yaml
|
|
||||||
@@ -8439,10 +8439,17 @@
|
|
||||||
#else
|
|
||||||
value: false
|
|
||||||
#endif
|
|
||||||
mirror: once
|
|
||||||
|
|
||||||
+# Make backdrop-filter treat its captured backdrop as if it had been
|
|
||||||
+# composited over an opaque-black background. (See bug 2036640)
|
|
||||||
+- name: gfx.webrender.opaque-backdrop-fallback
|
|
||||||
+ type: bool
|
|
||||||
+ value: true
|
|
||||||
+ mirror: once
|
|
||||||
+
|
|
||||||
# Disable wait of GPU execution completion
|
|
||||||
- name: gfx.webrender.wait-gpu-finished.disabled
|
|
||||||
type: bool
|
|
||||||
value: false
|
|
||||||
mirror: once
|
|
||||||
|
|
||||||
@@ -16,3 +16,4 @@ category app-startup nsBrowserGlue @mozilla.org/browser/browserglue;1 applicatio
|
|||||||
#include common/Components.manifest
|
#include common/Components.manifest
|
||||||
#include sessionstore/SessionComponents.manifest
|
#include sessionstore/SessionComponents.manifest
|
||||||
#include live-folders/LiveFoldersComponents.manifest
|
#include live-folders/LiveFoldersComponents.manifest
|
||||||
|
#include space-routing/SpaceRoutingComponents.manifest
|
||||||
|
|||||||
@@ -35,13 +35,6 @@ export class ZenSpaceRoutingNavigation extends ZenUIComponent {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The tab we spawn for a route must be allowed to load once without being
|
|
||||||
// redirected again, regardless of when its workspace attribute lands.
|
|
||||||
if (aBrowser._zenSkipNavRouteOnce) {
|
|
||||||
aBrowser._zenSkipNavRouteOnce = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let uri;
|
let uri;
|
||||||
try {
|
try {
|
||||||
uri = aRequest.QueryInterface(Ci.nsIChannel).URI;
|
uri = aRequest.QueryInterface(Ci.nsIChannel).URI;
|
||||||
@@ -80,16 +73,49 @@ export class ZenSpaceRoutingNavigation extends ZenUIComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const currentWorkspaceId = tab.getAttribute("zen-workspace-id");
|
const currentWorkspaceId = tab.getAttribute("zen-workspace-id");
|
||||||
if (
|
const targetWorkspaceId =
|
||||||
!win.gZenSpaceRoutingManager.shouldRedirectNavigation(
|
win.gZenSpaceRoutingManager.getRedirectTargetWorkspaceId(
|
||||||
uri.spec,
|
uri.spec,
|
||||||
currentWorkspaceId,
|
currentWorkspaceId,
|
||||||
win
|
win
|
||||||
)
|
);
|
||||||
) {
|
if (!targetWorkspaceId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// A brand-new tab whose very first real navigation this is (a
|
||||||
|
// target="_blank" link, window.open(), or a freshly opened tab) is still
|
||||||
|
// showing its initial about:blank document. There is nothing to preserve,
|
||||||
|
// so rather than cancelling the load and spawning a duplicate tab - which
|
||||||
|
// would leave this one behind empty - just move this very tab into the
|
||||||
|
// destination space and let the in-flight load finish in place.
|
||||||
|
const isInitialDocument =
|
||||||
|
aBrowser.browsingContext?.currentWindowGlobal?.isInitialDocument ?? false;
|
||||||
|
if (isInitialDocument) {
|
||||||
|
const wasSelected = tab.selected;
|
||||||
|
// Defer so we don't mutate the tab strip from inside a progress notification.
|
||||||
|
win.setTimeout(() => {
|
||||||
|
if (!tab.isConnected) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
gBrowser.selectedTab = tab.owner;
|
||||||
|
win.gZenWorkspaces.moveTabToWorkspace(tab, targetWorkspaceId);
|
||||||
|
if (wasSelected) {
|
||||||
|
const targetWorkspace =
|
||||||
|
win.gZenWorkspaces.getWorkspaceFromId(targetWorkspaceId);
|
||||||
|
if (targetWorkspace) {
|
||||||
|
win.gZenWorkspaces.lastSelectedWorkspaceTabs[targetWorkspaceId] =
|
||||||
|
tab;
|
||||||
|
win.gZenWorkspaces.changeWorkspace(targetWorkspace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// An already-loaded page is navigating in place. Preserve it in its current
|
||||||
|
// tab and re-open the destination in a new routed tab instead.
|
||||||
|
//
|
||||||
// Under Fission the parent-side aRequest is a RemoteWebProgress stand-in
|
// Under Fission the parent-side aRequest is a RemoteWebProgress stand-in
|
||||||
// whose cancel()/loadInfo throw NS_ERROR_NOT_IMPLEMENTED (the real channel
|
// whose cancel()/loadInfo throw NS_ERROR_NOT_IMPLEMENTED (the real channel
|
||||||
// lives in the content process). Stop the in-place load through the browser,
|
// lives in the content process). Stop the in-place load through the browser,
|
||||||
@@ -111,13 +137,14 @@ export class ZenSpaceRoutingNavigation extends ZenUIComponent {
|
|||||||
|
|
||||||
// Defer so we don't mutate the tab strip from inside a progress notification.
|
// Defer so we don't mutate the tab strip from inside a progress notification.
|
||||||
win.setTimeout(() => {
|
win.setTimeout(() => {
|
||||||
const newTab = gBrowser.addTab(urlToOpen, {
|
gBrowser.addTab(urlToOpen, {
|
||||||
triggeringPrincipal: principal,
|
triggeringPrincipal: principal,
|
||||||
ownerTab: tab.isConnected ? tab : null,
|
ownerTab: tab.isConnected ? tab : null,
|
||||||
|
// The user was actively navigating this tab, so follow the navigation
|
||||||
|
// into the routed tab instead of opening it in the background (addTab
|
||||||
|
// defaults inBackground to true).
|
||||||
|
inBackground: false,
|
||||||
});
|
});
|
||||||
if (newTab?.linkedBrowser) {
|
|
||||||
newTab.linkedBrowser._zenSkipNavRouteOnce = true;
|
|
||||||
}
|
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,6 +78,9 @@ document.addEventListener(
|
|||||||
case "cmd_zenReplacePinnedUrlWithCurrent":
|
case "cmd_zenReplacePinnedUrlWithCurrent":
|
||||||
gZenPinnedTabManager.replacePinnedUrlWithCurrent();
|
gZenPinnedTabManager.replacePinnedUrlWithCurrent();
|
||||||
break;
|
break;
|
||||||
|
case "cmd_zenEditPinnedUrl":
|
||||||
|
gZenPinnedTabManager.editPinnedUrl();
|
||||||
|
break;
|
||||||
case "cmd_contextZenAddToEssentials":
|
case "cmd_contextZenAddToEssentials":
|
||||||
gZenPinnedTabManager.addToEssentials();
|
gZenPinnedTabManager.addToEssentials();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1232,19 +1232,38 @@ class nsZenWindowSync {
|
|||||||
activeIndex = Math.min(activeIndex, entries.length - 1);
|
activeIndex = Math.min(activeIndex, entries.length - 1);
|
||||||
activeIndex = Math.max(activeIndex, 0);
|
activeIndex = Math.max(activeIndex, 0);
|
||||||
let entryToUse = (entries[activeIndex] || entries[0]) ?? null;
|
let entryToUse = (entries[activeIndex] || entries[0]) ?? null;
|
||||||
const initialState = {
|
this.#setPinnedInitialState(
|
||||||
entry: {
|
aTab,
|
||||||
url: entryToUse?.url,
|
{ url: entryToUse?.url, title: entryToUse?.title },
|
||||||
title: entryToUse?.title,
|
image
|
||||||
},
|
);
|
||||||
image,
|
});
|
||||||
};
|
}
|
||||||
this.#runOnAllWindows(null, win => {
|
|
||||||
const targetTab = this.getItemFromWindow(win, aTab.id);
|
/**
|
||||||
if (targetTab) {
|
* Sets the canonical pinned URL for a tab across all windows. Used to let the
|
||||||
targetTab._zenPinnedInitialState = initialState;
|
* user edit a pinned tab's URL directly.
|
||||||
}
|
*
|
||||||
});
|
* @param {object} aTab - The tab to set the pinned URL for.
|
||||||
|
* @param {string} aUrl - The URL to store as the canonical pinned URL.
|
||||||
|
* @param {string} [aImage] - Optional Icon to store.
|
||||||
|
*/
|
||||||
|
setPinnedUrl(aTab, aUrl, aImage) {
|
||||||
|
this.log(`Setting pinned url for tab ${aTab.id}`);
|
||||||
|
this.#setPinnedInitialState(
|
||||||
|
aTab,
|
||||||
|
{ url: aUrl, title: aTab.zenStaticLabel },
|
||||||
|
aImage
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#setPinnedInitialState(aTab, aEntry, aImage) {
|
||||||
|
const initialState = { entry: aEntry, image: aImage };
|
||||||
|
this.#runOnAllWindows(null, win => {
|
||||||
|
const targetTab = this.getItemFromWindow(win, aTab.id);
|
||||||
|
if (targetTab) {
|
||||||
|
targetTab._zenPinnedInitialState = initialState;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
5
src/zen/space-routing/SpaceRoutingComponents.manifest
Normal file
5
src/zen/space-routing/SpaceRoutingComponents.manifest
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# 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/.
|
||||||
|
|
||||||
|
category browser-window-delayed-startup resource:///modules/zen/spacerouting/ZenSpaceRoutingManager.sys.mjs gZenSpaceRoutingManager.onDelayedBrowserStartup
|
||||||
@@ -3,16 +3,6 @@
|
|||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
import { JSONFile } from "resource://gre/modules/JSONFile.sys.mjs";
|
import { JSONFile } from "resource://gre/modules/JSONFile.sys.mjs";
|
||||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
|
||||||
|
|
||||||
const lazy = {};
|
|
||||||
|
|
||||||
XPCOMUtils.defineLazyPreferenceGetter(
|
|
||||||
lazy,
|
|
||||||
"shouldForceContainerTabsToWorkspace",
|
|
||||||
"zen.workspaces.force-container-workspace",
|
|
||||||
false
|
|
||||||
);
|
|
||||||
|
|
||||||
class nsZenSpaceRoutingManager {
|
class nsZenSpaceRoutingManager {
|
||||||
#file = null;
|
#file = null;
|
||||||
@@ -28,6 +18,58 @@ class nsZenSpaceRoutingManager {
|
|||||||
this.#readFromDisk();
|
this.#readFromDisk();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto invoked for every window on delayed startup
|
||||||
|
*
|
||||||
|
* @param {nsIDOMWindow} window - The browser window that just started up
|
||||||
|
*/
|
||||||
|
onDelayedBrowserStartup(window) {
|
||||||
|
const element = window.MozXULElement.parseXULToFragment(`
|
||||||
|
<menuseparator/>
|
||||||
|
<menuitem id="context_zen-add-domain-to-routing"
|
||||||
|
data-lazy-l10n-id="tab-context-zen-add-domain-to-sr"
|
||||||
|
data-l10n-args='{"tabCount": 1}'/>
|
||||||
|
`);
|
||||||
|
window.document.getElementById("context_undoCloseTab").after(element);
|
||||||
|
|
||||||
|
window.document
|
||||||
|
.getElementById("context_zen-add-domain-to-routing")
|
||||||
|
.addEventListener("command", this.#onAddSelectedToRouting.bind(this));
|
||||||
|
window.document
|
||||||
|
.getElementById("tabContextMenu")
|
||||||
|
.addEventListener(
|
||||||
|
"popupshowing",
|
||||||
|
this.#updateTabCloseCountState.bind(this)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the "context_zen-add-domain-to-routing" command
|
||||||
|
* to reflect the number of selected tabs, when applicable.
|
||||||
|
*
|
||||||
|
* @param {Event} event - The event param
|
||||||
|
*/
|
||||||
|
#updateTabCloseCountState(event) {
|
||||||
|
const window = event.target.documentGlobal;
|
||||||
|
window.document.l10n.setArgs(
|
||||||
|
window.document.getElementById("context_zen-add-domain-to-routing"),
|
||||||
|
{ tabCount: window.gBrowser.selectedTabs.length }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback for whenever the menuitem command is ran
|
||||||
|
*
|
||||||
|
* @param {Event} event - The event parameter
|
||||||
|
*/
|
||||||
|
#onAddSelectedToRouting(event) {
|
||||||
|
const window = event.target.documentGlobal;
|
||||||
|
const tabs = window.TabContextMenu.contextTab.multiselected
|
||||||
|
? window.gBrowser.selectedTabs
|
||||||
|
: [window.TabContextMenu.contextTab];
|
||||||
|
this.addRouteForSelected(tabs, window);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback that will be executed from tabbrowser.js
|
* Callback that will be executed from tabbrowser.js
|
||||||
* This method can be used to stop the tab from being created.
|
* This method can be used to stop the tab from being created.
|
||||||
@@ -62,7 +104,7 @@ class nsZenSpaceRoutingManager {
|
|||||||
break;
|
break;
|
||||||
default: {
|
default: {
|
||||||
const targetWorkspace =
|
const targetWorkspace =
|
||||||
win?.gZenWorkspaces?.getWorkspaceFromId(targetRoute);
|
win.gZenWorkspaces.getWorkspaceFromId(targetRoute);
|
||||||
|
|
||||||
if (targetWorkspace) {
|
if (targetWorkspace) {
|
||||||
userContextId = targetWorkspace.containerTabId;
|
userContextId = targetWorkspace.containerTabId;
|
||||||
@@ -72,37 +114,6 @@ class nsZenSpaceRoutingManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isRouteFound) {
|
|
||||||
let tabSpaceId = options.zenWorkspaceId;
|
|
||||||
let spaceManager = win.gZenWorkspaces;
|
|
||||||
if (lazy.shouldForceContainerTabsToWorkspace) {
|
|
||||||
// In case its undefined, to make it into an integer.
|
|
||||||
const tabContainerId = options.userContextId || 0;
|
|
||||||
const currentSpace = spaceManager.getActiveWorkspaceFromCache();
|
|
||||||
console.log("[ZenSpaceRouting] Tab is opening with userContextId", tabContainerId, "and active space has containerTabId", currentSpace.containerTabId);
|
|
||||||
if (tabContainerId !== currentSpace.containerTabId) {
|
|
||||||
const targetWorkspace = spaceManager.getWorkspaces().find(
|
|
||||||
workspace => workspace.containerTabId === tabContainerId
|
|
||||||
);
|
|
||||||
if (targetWorkspace) {
|
|
||||||
tabSpaceId = targetWorkspace.uuid;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Add support for zen.workspaces.force-container-workspace in SR,
|
|
||||||
// instead of using the old implementation. Lets create a temporary route
|
|
||||||
// for this tab, so that it will be routed to the correct space.
|
|
||||||
if (tabSpaceId && tabSpaceId !== spaceManager.activeWorkspace) {
|
|
||||||
const targetWorkspace = spaceManager.getWorkspaceFromId(tabSpaceId);
|
|
||||||
if (targetWorkspace) {
|
|
||||||
userContextId = targetWorkspace.containerTabId;
|
|
||||||
isRouteFound = true;
|
|
||||||
targetWorkspaceName = targetWorkspace.name;
|
|
||||||
targetRoute = tabSpaceId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
shouldEarlyExit: false,
|
shouldEarlyExit: false,
|
||||||
userContextId,
|
userContextId,
|
||||||
@@ -148,8 +159,26 @@ class nsZenSpaceRoutingManager {
|
|||||||
* @returns {boolean} True when the navigation should open in a new routed tab
|
* @returns {boolean} True when the navigation should open in a new routed tab
|
||||||
*/
|
*/
|
||||||
shouldRedirectNavigation(uriString, currentWorkspaceId, win) {
|
shouldRedirectNavigation(uriString, currentWorkspaceId, win) {
|
||||||
|
return !!this.getRedirectTargetWorkspaceId(
|
||||||
|
uriString,
|
||||||
|
currentWorkspaceId,
|
||||||
|
win
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resolves the destination space for an in-place top-level navigation, or
|
||||||
|
* null when the navigation should be left alone (no rule, the destination is
|
||||||
|
* "most-recent-space", the tab already lives there, or the space is gone).
|
||||||
|
*
|
||||||
|
* @param {string} uriString - The destination URI
|
||||||
|
* @param {string|null} currentWorkspaceId - The zen-workspace-id of the navigating tab
|
||||||
|
* @param {Window} win - The owning browser window
|
||||||
|
* @returns {string|null} The target workspace id, or null to leave the navigation in place
|
||||||
|
*/
|
||||||
|
getRedirectTargetWorkspaceId(uriString, currentWorkspaceId, win) {
|
||||||
if (!win?.gZenWorkspaces?.workspaceEnabled) {
|
if (!win?.gZenWorkspaces?.workspaceEnabled) {
|
||||||
return false;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const targetRoute = this.routeUri(uriString, { fromExternal: false });
|
const targetRoute = this.routeUri(uriString, { fromExternal: false });
|
||||||
@@ -159,11 +188,13 @@ class nsZenSpaceRoutingManager {
|
|||||||
targetRoute === "most-recent-space" ||
|
targetRoute === "most-recent-space" ||
|
||||||
targetRoute === currentWorkspaceId
|
targetRoute === currentWorkspaceId
|
||||||
) {
|
) {
|
||||||
return false;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only redirect when the destination space actually exists.
|
// Only redirect when the destination space actually exists.
|
||||||
return !!win.gZenWorkspaces.getWorkspaceFromId(targetRoute);
|
return win.gZenWorkspaces.getWorkspaceFromId(targetRoute)
|
||||||
|
? targetRoute
|
||||||
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -208,8 +239,8 @@ class nsZenSpaceRoutingManager {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
const workspaces = win.gZenWorkspaces;
|
const workspaces = win?.gZenWorkspaces;
|
||||||
const targetWorkspace = workspaces.getWorkspaceFromId(targetRoute);
|
const targetWorkspace = workspaces?.getWorkspaceFromId?.(targetRoute);
|
||||||
|
|
||||||
if (targetWorkspace) {
|
if (targetWorkspace) {
|
||||||
workspaces.moveTabToWorkspace(newTab, targetWorkspace.uuid);
|
workspaces.moveTabToWorkspace(newTab, targetWorkspace.uuid);
|
||||||
@@ -444,6 +475,37 @@ class nsZenSpaceRoutingManager {
|
|||||||
this.#file.data.defaultRouteExternal = routeType;
|
this.#file.data.defaultRouteExternal = routeType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds a new route for all given tabs
|
||||||
|
*
|
||||||
|
* @param {Array<object>} selectedTabs - The tabs that should be routed
|
||||||
|
* @param {Window} parentWindow - The window from which this is being executed
|
||||||
|
*/
|
||||||
|
addRouteForSelected(selectedTabs, parentWindow) {
|
||||||
|
const newRoute = this.createNewRoute();
|
||||||
|
let routeReference = "";
|
||||||
|
|
||||||
|
if (selectedTabs.length == 1) {
|
||||||
|
newRoute.matchType = "contains";
|
||||||
|
routeReference = selectedTabs[0].linkedBrowser.currentURI.host;
|
||||||
|
} else {
|
||||||
|
newRoute.matchType = "regex";
|
||||||
|
routeReference = "(";
|
||||||
|
for (let i = 0; i < selectedTabs.length; i++) {
|
||||||
|
const domain = selectedTabs[i].linkedBrowser.currentURI.host;
|
||||||
|
routeReference += domain.replaceAll(".", "\.");
|
||||||
|
if (i != selectedTabs.length - 1) {
|
||||||
|
routeReference += "|";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
routeReference += ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
newRoute.reference = routeReference;
|
||||||
|
this.updateRoute(newRoute);
|
||||||
|
this.openSpaceRoutingDialog(parentWindow);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves all routes. The list of
|
* Saves all routes. The list of
|
||||||
* routes is stripped of empty routes
|
* routes is stripped of empty routes
|
||||||
|
|||||||
@@ -106,6 +106,12 @@ class nsZenWorkspaces {
|
|||||||
"zen.workspaces.wrap-around-navigation",
|
"zen.workspaces.wrap-around-navigation",
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
XPCOMUtils.defineLazyPreferenceGetter(
|
||||||
|
this,
|
||||||
|
"shouldForceContainerTabsToWorkspace",
|
||||||
|
"zen.workspaces.force-container-workspace",
|
||||||
|
true
|
||||||
|
);
|
||||||
XPCOMUtils.defineLazyPreferenceGetter(
|
XPCOMUtils.defineLazyPreferenceGetter(
|
||||||
this,
|
this,
|
||||||
"shouldOpenNewTabIfLastUnpinnedTabIsClosed",
|
"shouldOpenNewTabIfLastUnpinnedTabIsClosed",
|
||||||
@@ -782,6 +788,11 @@ class nsZenWorkspaces {
|
|||||||
window.addEventListener("TabUnpinned", tabUpdateListener);
|
window.addEventListener("TabUnpinned", tabUpdateListener);
|
||||||
window.addEventListener("aftercustomization", tabUpdateListener);
|
window.addEventListener("aftercustomization", tabUpdateListener);
|
||||||
window.addEventListener("TabSelect", this.onLocationChange.bind(this));
|
window.addEventListener("TabSelect", this.onLocationChange.bind(this));
|
||||||
|
window.addEventListener(
|
||||||
|
"TabBrowserInserted",
|
||||||
|
this.onTabBrowserInserted.bind(this)
|
||||||
|
);
|
||||||
|
|
||||||
this.updateWorkspacesChangeContextMenu();
|
this.updateWorkspacesChangeContextMenu();
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
@@ -1495,15 +1506,15 @@ class nsZenWorkspaces {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const newtabPlacement = Services.prefs.getBoolPref(
|
|
||||||
"zen.view.show-newtab-button-top",
|
|
||||||
false
|
|
||||||
);
|
|
||||||
const insertElement = newtabPlacement
|
|
||||||
? container.firstChild
|
|
||||||
: container.lastChild;
|
|
||||||
|
|
||||||
if (container) {
|
if (container) {
|
||||||
|
const newtabPlacement = Services.prefs.getBoolPref(
|
||||||
|
"zen.view.show-newtab-button-top",
|
||||||
|
false
|
||||||
|
);
|
||||||
|
const insertElement = newtabPlacement
|
||||||
|
? container.firstChild
|
||||||
|
: container.lastChild;
|
||||||
|
|
||||||
if (tab.group?.hasAttribute("split-view-group")) {
|
if (tab.group?.hasAttribute("split-view-group")) {
|
||||||
gBrowser.zenHandleTabMove(tab.group, () => {
|
gBrowser.zenHandleTabMove(tab.group, () => {
|
||||||
for (const subTab of tab.group.tabs) {
|
for (const subTab of tab.group.tabs) {
|
||||||
@@ -2287,12 +2298,12 @@ class nsZenWorkspaces {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onBeforeTabSelect(aTab) {
|
onBeforeTabSelect(aTab) {
|
||||||
if (this.#inChangingWorkspace) {
|
if (this.#inChangingWorkspace || !aTab) {
|
||||||
// Just in case, Let's not do these checks while we are
|
// Just in case, Let's not do these checks while we are
|
||||||
// in the middle of changing workspace,
|
// in the middle of changing workspace,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const tabSpace = aTab?.getAttribute("zen-workspace-id");
|
const tabSpace = aTab.getAttribute("zen-workspace-id");
|
||||||
if (
|
if (
|
||||||
tabSpace &&
|
tabSpace &&
|
||||||
tabSpace !== this.activeWorkspace &&
|
tabSpace !== this.activeWorkspace &&
|
||||||
@@ -2783,6 +2794,44 @@ class nsZenWorkspaces {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async onTabBrowserInserted(event) {
|
||||||
|
let tab = event.originalTarget;
|
||||||
|
const isEssential = tab.getAttribute("zen-essential") === "true";
|
||||||
|
const workspaceID = tab.getAttribute("zen-workspace-id");
|
||||||
|
|
||||||
|
if (!this.workspaceEnabled || isEssential) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (workspaceID) {
|
||||||
|
if (
|
||||||
|
tab.hasAttribute("change-workspace") &&
|
||||||
|
this.moveTabToWorkspace(tab, workspaceID)
|
||||||
|
) {
|
||||||
|
this.lastSelectedWorkspaceTabs[workspaceID] =
|
||||||
|
gZenGlanceManager.getTabOrGlanceParent(tab);
|
||||||
|
tab.removeAttribute("change-workspace");
|
||||||
|
const workspace = this.getWorkspaceFromId(workspaceID);
|
||||||
|
setTimeout(() => {
|
||||||
|
this.changeWorkspace(workspace);
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let activeWorkspace = this.getActiveWorkspace();
|
||||||
|
if (!activeWorkspace) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (tab.hasAttribute("zen-workspace-id")) {
|
||||||
|
const tabWorkspaceId = tab.getAttribute("zen-workspace-id");
|
||||||
|
this.moveTabToWorkspace(tab, tabWorkspaceId);
|
||||||
|
await this.changeWorkspaceWithID(tabWorkspaceId);
|
||||||
|
} else {
|
||||||
|
tab.setAttribute("zen-workspace-id", activeWorkspace.uuid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#changeToEmptyTab() {
|
#changeToEmptyTab() {
|
||||||
const isEmpty = gBrowser.selectedTab.hasAttribute("zen-empty-tab");
|
const isEmpty = gBrowser.selectedTab.hasAttribute("zen-empty-tab");
|
||||||
gZenCompactModeManager.sidebar.toggleAttribute(
|
gZenCompactModeManager.sidebar.toggleAttribute(
|
||||||
@@ -2968,7 +3017,7 @@ class nsZenWorkspaces {
|
|||||||
|
|
||||||
getContextIdIfNeeded(userContextId, fromExternal, triggeringPrincipal) {
|
getContextIdIfNeeded(userContextId, fromExternal, triggeringPrincipal) {
|
||||||
if (!this.workspaceEnabled) {
|
if (!this.workspaceEnabled) {
|
||||||
return [userContextId, false];
|
return [userContextId, false, undefined];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@@ -2976,7 +3025,27 @@ class nsZenWorkspaces {
|
|||||||
triggeringPrincipal.isAddonOrExpandedAddonPrincipal &&
|
triggeringPrincipal.isAddonOrExpandedAddonPrincipal &&
|
||||||
typeof userContextId === "undefined"
|
typeof userContextId === "undefined"
|
||||||
) {
|
) {
|
||||||
return [userContextId, false];
|
return [userContextId, false, undefined];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
this.shouldForceContainerTabsToWorkspace &&
|
||||||
|
typeof userContextId !== "undefined" &&
|
||||||
|
this._workspaceCache &&
|
||||||
|
!fromExternal
|
||||||
|
) {
|
||||||
|
// Find all workspaces that match the given userContextId
|
||||||
|
const matchingWorkspaces = this._workspaceCache.filter(
|
||||||
|
workspace => workspace.containerTabId === userContextId
|
||||||
|
);
|
||||||
|
|
||||||
|
// Check if exactly one workspace matches
|
||||||
|
if (matchingWorkspaces.length === 1) {
|
||||||
|
const workspace = matchingWorkspaces[0];
|
||||||
|
if (workspace.uuid !== this.getActiveWorkspaceFromCache().uuid) {
|
||||||
|
return [userContextId, true, workspace.uuid];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const activeWorkspace = this.getActiveWorkspaceFromCache();
|
const activeWorkspace = this.getActiveWorkspaceFromCache();
|
||||||
@@ -2987,9 +3056,9 @@ class nsZenWorkspaces {
|
|||||||
typeof userContextId !== "undefined" &&
|
typeof userContextId !== "undefined" &&
|
||||||
userContextId !== activeWorkspaceUserContextId
|
userContextId !== activeWorkspaceUserContextId
|
||||||
) {
|
) {
|
||||||
return [userContextId, false];
|
return [userContextId, false, undefined];
|
||||||
}
|
}
|
||||||
return [activeWorkspaceUserContextId, true];
|
return [activeWorkspaceUserContextId, true, undefined];
|
||||||
}
|
}
|
||||||
|
|
||||||
getTabsToExclude(aTab) {
|
getTabsToExclude(aTab) {
|
||||||
|
|||||||
@@ -1240,13 +1240,17 @@ class nsZenViewSplitter extends nsZenDOMOperatedFeature {
|
|||||||
*/
|
*/
|
||||||
contextSplitTabs(otherTabHint = null) {
|
contextSplitTabs(otherTabHint = null) {
|
||||||
let tabs;
|
let tabs;
|
||||||
let currentTab = TabContextMenu.contextTab || gBrowser.selectedTab;
|
let currentTab = gZenGlanceManager.getTabOrGlanceParent(
|
||||||
|
TabContextMenu.contextTab || gBrowser.selectedTab
|
||||||
|
);
|
||||||
if (currentTab.multiselected) {
|
if (currentTab.multiselected) {
|
||||||
tabs = gBrowser.selectedTabs;
|
tabs = gBrowser.selectedTabs;
|
||||||
} else if (!currentTab.selected && !currentTab.splitView) {
|
} else if (!currentTab.selected && !currentTab.splitView) {
|
||||||
tabs = [
|
tabs = [
|
||||||
currentTab,
|
currentTab,
|
||||||
...gBrowser.selectedTabs.filter(t => t !== currentTab),
|
...gBrowser.selectedTabs.filter(
|
||||||
|
t => t !== currentTab && !t.hasAttribute("zen-glance-tab")
|
||||||
|
),
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
tabs = [currentTab];
|
tabs = [currentTab];
|
||||||
|
|||||||
@@ -246,6 +246,66 @@ class nsZenPinnedTabManager extends nsZenDOMOperatedFeature {
|
|||||||
gZenUIManager.showToast("zen-pinned-tab-replaced");
|
gZenUIManager.showToast("zen-pinned-tab-replaced");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async editPinnedUrl(tab = undefined) {
|
||||||
|
tab ??= TabContextMenu.contextTab;
|
||||||
|
if (!tab || !tab.pinned) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const initialUrl =
|
||||||
|
tab._zenPinnedInitialState?.entry?.url ||
|
||||||
|
tab.linkedBrowser?.currentURI?.spec;
|
||||||
|
const [title, label] = await document.l10n.formatValues([
|
||||||
|
{ id: "zen-pinned-tab-edit-url-title" },
|
||||||
|
{ id: "zen-pinned-tab-edit-url-label" },
|
||||||
|
]);
|
||||||
|
const result = { value: initialUrl ?? "" };
|
||||||
|
const confirmed = Services.prompt.prompt(
|
||||||
|
window,
|
||||||
|
title,
|
||||||
|
label,
|
||||||
|
result,
|
||||||
|
null,
|
||||||
|
{ value: false }
|
||||||
|
);
|
||||||
|
if (!confirmed) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let uri;
|
||||||
|
try {
|
||||||
|
uri = Services.uriFixup.getFixupURIInfo(
|
||||||
|
result.value.trim(),
|
||||||
|
Ci.nsIURIFixup.FIXUP_FLAG_FIX_SCHEME_TYPOS
|
||||||
|
).preferredURI;
|
||||||
|
} catch (_) {}
|
||||||
|
if (!uri) {
|
||||||
|
gZenUIManager.showToast("zen-pinned-tab-url-invalid");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const url = uri.spec;
|
||||||
|
|
||||||
|
// Skip when the value wasn't actually changed from what was prefilled.
|
||||||
|
if (!url || url === initialUrl) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const image = tab.zenStaticIcon || (await this.#getCachedFavicon(uri));
|
||||||
|
window.gZenWindowSync.setPinnedUrl(tab, url, image);
|
||||||
|
this.#resetTabToStoredState(tab);
|
||||||
|
gZenUIManager.showToast("zen-pinned-tab-url-edited");
|
||||||
|
}
|
||||||
|
|
||||||
|
async #getCachedFavicon(uri) {
|
||||||
|
try {
|
||||||
|
const favicon = await PlacesUtils.favicons.getFaviconForPage(uri);
|
||||||
|
return favicon?.dataURI?.spec;
|
||||||
|
} catch (ex) {
|
||||||
|
console.error("Failed to get favicon for edited pinned url:", ex);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_initClosePinnedTabShortcut() {
|
_initClosePinnedTabShortcut() {
|
||||||
let cmdClose = document.getElementById("cmd_close");
|
let cmdClose = document.getElementById("cmd_close");
|
||||||
|
|
||||||
@@ -545,11 +605,20 @@ class nsZenPinnedTabManager extends nsZenDOMOperatedFeature {
|
|||||||
}
|
}
|
||||||
const elements = window.MozXULElement.parseXULToFragment(`
|
const elements = window.MozXULElement.parseXULToFragment(`
|
||||||
<menuseparator id="context_zen-pinned-tab-separator" hidden="true"/>
|
<menuseparator id="context_zen-pinned-tab-separator" hidden="true"/>
|
||||||
<menuitem id="context_zen-replace-pinned-url-with-current"
|
<menu id="context_zen-edit-pinned-page"
|
||||||
data-lazy-l10n-id="tab-context-zen-replace-pinned-url-with-current"
|
data-lazy-l10n-id="tab-context-zen-edit-pinned-page"
|
||||||
data-l10n-args="{"isEssential":""}"
|
data-l10n-args="{"isEssential":""}"
|
||||||
hidden="true"
|
hidden="true">
|
||||||
command="cmd_zenReplacePinnedUrlWithCurrent"/>
|
<menupopup>
|
||||||
|
<menuitem id="context_zen-replace-pinned-url-with-current"
|
||||||
|
data-lazy-l10n-id="tab-context-zen-replace-pinned-url-with-current"
|
||||||
|
data-l10n-args="{"isEssential":""}"
|
||||||
|
command="cmd_zenReplacePinnedUrlWithCurrent"/>
|
||||||
|
<menuitem id="context_zen-edit-pinned-url"
|
||||||
|
data-lazy-l10n-id="tab-context-zen-edit-pinned-url"
|
||||||
|
command="cmd_zenEditPinnedUrl"/>
|
||||||
|
</menupopup>
|
||||||
|
</menu>
|
||||||
<menuitem id="context_zen-reset-pinned-tab"
|
<menuitem id="context_zen-reset-pinned-tab"
|
||||||
data-lazy-l10n-id="tab-context-zen-reset-pinned-tab"
|
data-lazy-l10n-id="tab-context-zen-reset-pinned-tab"
|
||||||
data-l10n-args="{"isEssential":""}"
|
data-l10n-args="{"isEssential":""}"
|
||||||
@@ -619,15 +688,24 @@ class nsZenPinnedTabManager extends nsZenDOMOperatedFeature {
|
|||||||
const zenResetPinnedTab = document.getElementById(
|
const zenResetPinnedTab = document.getElementById(
|
||||||
"context_zen-reset-pinned-tab"
|
"context_zen-reset-pinned-tab"
|
||||||
);
|
);
|
||||||
|
const zenEditPinnedPage = document.getElementById(
|
||||||
|
"context_zen-edit-pinned-page"
|
||||||
|
);
|
||||||
const zenReplacePinnedUrl = document.getElementById(
|
const zenReplacePinnedUrl = document.getElementById(
|
||||||
"context_zen-replace-pinned-url-with-current"
|
"context_zen-replace-pinned-url-with-current"
|
||||||
);
|
);
|
||||||
[zenResetPinnedTab, zenReplacePinnedUrl].forEach(element => {
|
[zenResetPinnedTab, zenEditPinnedPage].forEach(element => {
|
||||||
if (element) {
|
if (element) {
|
||||||
element.hidden = !isVisible;
|
element.hidden = !isVisible;
|
||||||
document.l10n.setArgs(element, { isEssential });
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
[zenResetPinnedTab, zenEditPinnedPage, zenReplacePinnedUrl].forEach(
|
||||||
|
element => {
|
||||||
|
if (element) {
|
||||||
|
document.l10n.setArgs(element, { isEssential });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
zenAddEssential.hidden = isEssential || !!contextTab.group;
|
zenAddEssential.hidden = isEssential || !!contextTab.group;
|
||||||
document.l10n
|
document.l10n
|
||||||
.formatValue("tab-context-zen-add-essential-badge", {
|
.formatValue("tab-context-zen-add-essential-badge", {
|
||||||
@@ -857,7 +935,7 @@ class nsZenPinnedTabManager extends nsZenDOMOperatedFeature {
|
|||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Remove # and ? from the URL
|
// Remove # from the URL
|
||||||
const pinUrl = tab._zenPinnedInitialState.entry.url.split("#")[0];
|
const pinUrl = tab._zenPinnedInitialState.entry.url.split("#")[0];
|
||||||
const currentUrl = location.split("#")[0];
|
const currentUrl = location.split("#")[0];
|
||||||
// Add an indicator that the pin has been changed
|
// Add an indicator that the pin has been changed
|
||||||
@@ -897,10 +975,14 @@ class nsZenPinnedTabManager extends nsZenDOMOperatedFeature {
|
|||||||
} else {
|
} else {
|
||||||
tab.setAttribute("zen-pinned-changed", "true");
|
tab.setAttribute("zen-pinned-changed", "true");
|
||||||
}
|
}
|
||||||
tab.style.setProperty(
|
if (tab._zenPinnedInitialState.image) {
|
||||||
"--zen-original-tab-icon",
|
tab.style.setProperty(
|
||||||
`url(${tab._zenPinnedInitialState.image})`
|
"--zen-original-tab-icon",
|
||||||
);
|
`url(${tab._zenPinnedInitialState.image})`
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
tab.style.removeProperty("--zen-original-tab-icon");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
removeTabContainersDragoverClass(hideIndicator = true) {
|
removeTabContainersDragoverClass(hideIndicator = true) {
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ prefs = ["zen.workspaces.separate-essentials=false"]
|
|||||||
|
|
||||||
["browser_pinned_created.js"]
|
["browser_pinned_created.js"]
|
||||||
|
|
||||||
|
["browser_pinned_edit_url.js"]
|
||||||
|
|
||||||
["browser_pinned_nounload_reset.js"]
|
["browser_pinned_nounload_reset.js"]
|
||||||
|
|
||||||
["browser_pinned_reset_button.js"]
|
["browser_pinned_reset_button.js"]
|
||||||
|
|||||||
384
src/zen/tests/pinned/browser_pinned_edit_url.js
Normal file
384
src/zen/tests/pinned/browser_pinned_edit_url.js
Normal file
@@ -0,0 +1,384 @@
|
|||||||
|
/* Any copyright is dedicated to the Public Domain.
|
||||||
|
https://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
async function pinTab(url) {
|
||||||
|
const tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, url);
|
||||||
|
gBrowser.pinTab(tab);
|
||||||
|
await gBrowser.TabStateFlusher.flush(tab.linkedBrowser);
|
||||||
|
// eslint-disable-next-line mozilla/no-arbitrary-setTimeout
|
||||||
|
await new Promise(r => setTimeout(r, 500));
|
||||||
|
return tab;
|
||||||
|
}
|
||||||
|
|
||||||
|
// XPCOM service methods can't be stubbed in place (non-configurable), so we
|
||||||
|
// swap the whole service object out for a mock and restore it afterwards.
|
||||||
|
function mockPrompt(value) {
|
||||||
|
const original = Services.prompt;
|
||||||
|
Services.prompt = {
|
||||||
|
QueryInterface: ChromeUtils.generateQI([Ci.nsIPromptService]),
|
||||||
|
prompt(win, title, label, result) {
|
||||||
|
if (value === null) {
|
||||||
|
return false; // user cancelled
|
||||||
|
}
|
||||||
|
result.value = value;
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
return () => {
|
||||||
|
Services.prompt = original;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function mockFavicons(faviconSpec) {
|
||||||
|
const original = PlacesUtils.favicons;
|
||||||
|
const mock = {
|
||||||
|
callCount: 0,
|
||||||
|
defaultFavicon: { spec: "data:image/png;base64,DEFAULT" },
|
||||||
|
getFaviconForPage() {
|
||||||
|
mock.callCount++;
|
||||||
|
return Promise.resolve(
|
||||||
|
faviconSpec ? { dataURI: { spec: faviconSpec } } : null
|
||||||
|
);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
PlacesUtils.favicons = mock;
|
||||||
|
return {
|
||||||
|
mock,
|
||||||
|
restore: () => {
|
||||||
|
PlacesUtils.favicons = original;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
add_task(async function test_EditPinnedUrl_SurvivesRebuild() {
|
||||||
|
// Pinned tab at url1 (loaded), then select a different tab (unfocus it).
|
||||||
|
const tab = await pinTab("https://example.com/1");
|
||||||
|
const other = await BrowserTestUtils.openNewForegroundTab(
|
||||||
|
gBrowser,
|
||||||
|
"https://example.com/other"
|
||||||
|
);
|
||||||
|
|
||||||
|
const editedUrl = "https://example.com/edited";
|
||||||
|
const restorePrompt = mockPrompt(editedUrl);
|
||||||
|
const favicons = mockFavicons("data:image/png;base64,iVBORw0KGgo=");
|
||||||
|
try {
|
||||||
|
await gZenPinnedTabManager.editPinnedUrl(tab);
|
||||||
|
|
||||||
|
// Close + re-open rebuilds the tab: the in-memory _zenPinnedInitialState is
|
||||||
|
// gone and gets reconstructed from the persisted session via
|
||||||
|
// setPinnedTabState (exactly what #onSessionStoreInitialized does).
|
||||||
|
delete tab._zenPinnedInitialState;
|
||||||
|
await window.gZenWindowSync.setPinnedTabState(tab);
|
||||||
|
|
||||||
|
Assert.equal(
|
||||||
|
tab._zenPinnedInitialState.entry.url,
|
||||||
|
editedUrl,
|
||||||
|
"After the tab is rebuilt, the pinned URL should still be the edited one"
|
||||||
|
);
|
||||||
|
} finally {
|
||||||
|
restorePrompt();
|
||||||
|
favicons.restore();
|
||||||
|
await BrowserTestUtils.removeTab(other);
|
||||||
|
await BrowserTestUtils.removeTab(tab);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
add_task(async function test_EditPinnedUrl_ActiveTabNavigates() {
|
||||||
|
// Editing the active (focused) pinned tab applies the new URL immediately:
|
||||||
|
// the live tab navigates to it (matching Arc's behavior).
|
||||||
|
const tab = await pinTab("https://example.com/1");
|
||||||
|
Assert.equal(gBrowser.selectedTab, tab, "the pinned tab should be active");
|
||||||
|
|
||||||
|
const editedUrl = "https://example.com/edited";
|
||||||
|
const restorePrompt = mockPrompt(editedUrl);
|
||||||
|
const favicons = mockFavicons("data:image/png;base64,iVBORw0KGgo=");
|
||||||
|
try {
|
||||||
|
await gZenPinnedTabManager.editPinnedUrl(tab);
|
||||||
|
await BrowserTestUtils.waitForCondition(
|
||||||
|
() => tab.linkedBrowser.currentURI.spec === editedUrl,
|
||||||
|
"the active pinned tab to navigate to the edited URL"
|
||||||
|
);
|
||||||
|
|
||||||
|
Assert.equal(
|
||||||
|
tab.linkedBrowser.currentURI.spec,
|
||||||
|
editedUrl,
|
||||||
|
"Editing the active pinned tab should navigate it to the new URL"
|
||||||
|
);
|
||||||
|
} finally {
|
||||||
|
restorePrompt();
|
||||||
|
favicons.restore();
|
||||||
|
await BrowserTestUtils.removeTab(tab);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
add_task(
|
||||||
|
async function test_EditPinnedUrl_FaviconLookupErrorLeavesImageEmpty() {
|
||||||
|
const tab = await pinTab("https://example.com/1");
|
||||||
|
const restorePrompt = mockPrompt("https://example.org/edited");
|
||||||
|
const favicons = mockFavicons(null);
|
||||||
|
// Simulate a Places DB failure so #getCachedFavicon hits its catch branch.
|
||||||
|
favicons.mock.getFaviconForPage = () =>
|
||||||
|
Promise.reject(new Error("simulated favicon DB failure"));
|
||||||
|
|
||||||
|
try {
|
||||||
|
await gZenPinnedTabManager.editPinnedUrl(tab);
|
||||||
|
|
||||||
|
Assert.equal(
|
||||||
|
tab._zenPinnedInitialState.entry.url,
|
||||||
|
"https://example.org/edited",
|
||||||
|
"The URL should still be updated when the favicon lookup fails"
|
||||||
|
);
|
||||||
|
ok(
|
||||||
|
!tab._zenPinnedInitialState.image,
|
||||||
|
"The image should be left empty (populated by the next navigation)"
|
||||||
|
);
|
||||||
|
} finally {
|
||||||
|
restorePrompt();
|
||||||
|
favicons.restore();
|
||||||
|
await BrowserTestUtils.removeTab(tab);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
add_task(async function test_EditPinnedUrl_UpdatesUrlAndFavicon() {
|
||||||
|
const tab = await pinTab("https://example.com/1");
|
||||||
|
const faviconSpec = "data:image/png;base64,iVBORw0KGgo=";
|
||||||
|
const restorePrompt = mockPrompt("https://example.org/edited");
|
||||||
|
const favicons = mockFavicons(faviconSpec);
|
||||||
|
|
||||||
|
try {
|
||||||
|
await gZenPinnedTabManager.editPinnedUrl(tab);
|
||||||
|
|
||||||
|
Assert.equal(
|
||||||
|
tab._zenPinnedInitialState.entry.url,
|
||||||
|
"https://example.org/edited",
|
||||||
|
"The pinned URL should be updated to the edited value"
|
||||||
|
);
|
||||||
|
Assert.equal(
|
||||||
|
tab._zenPinnedInitialState.image,
|
||||||
|
faviconSpec,
|
||||||
|
"The stored icon should be the cached favicon for the new URL"
|
||||||
|
);
|
||||||
|
} finally {
|
||||||
|
restorePrompt();
|
||||||
|
favicons.restore();
|
||||||
|
await BrowserTestUtils.removeTab(tab);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
add_task(async function test_EditPinnedUrl_NoCachedFaviconLeavesImageEmpty() {
|
||||||
|
const tab = await pinTab("https://example.com/1");
|
||||||
|
const restorePrompt = mockPrompt("https://example.org/edited");
|
||||||
|
const favicons = mockFavicons(null); // no cached favicon for the new URL
|
||||||
|
|
||||||
|
try {
|
||||||
|
await gZenPinnedTabManager.editPinnedUrl(tab);
|
||||||
|
|
||||||
|
ok(
|
||||||
|
!tab._zenPinnedInitialState.image,
|
||||||
|
"Without a cached favicon the image is left empty, not the default; the " +
|
||||||
|
"next navigation captures the real icon"
|
||||||
|
);
|
||||||
|
} finally {
|
||||||
|
restorePrompt();
|
||||||
|
favicons.restore();
|
||||||
|
await BrowserTestUtils.removeTab(tab);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
add_task(async function test_EditPinnedUrl_ClearsStaleTitle() {
|
||||||
|
const tab = await pinTab("https://example.com/1");
|
||||||
|
const restorePrompt = mockPrompt("https://example.org/edited");
|
||||||
|
const favicons = mockFavicons("data:image/png;base64,iVBORw0KGgo=");
|
||||||
|
|
||||||
|
try {
|
||||||
|
await gZenPinnedTabManager.editPinnedUrl(tab);
|
||||||
|
|
||||||
|
ok(
|
||||||
|
!tab._zenPinnedInitialState.entry.title,
|
||||||
|
"The previous title is cleared so the new page's title is used on load"
|
||||||
|
);
|
||||||
|
} finally {
|
||||||
|
restorePrompt();
|
||||||
|
favicons.restore();
|
||||||
|
await BrowserTestUtils.removeTab(tab);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
add_task(async function test_EditPinnedUrl_KeepsCustomLabel() {
|
||||||
|
const tab = await pinTab("https://example.com/1");
|
||||||
|
tab.zenStaticLabel = "My Pinned Tab";
|
||||||
|
const restorePrompt = mockPrompt("https://example.org/edited");
|
||||||
|
const favicons = mockFavicons("data:image/png;base64,iVBORw0KGgo=");
|
||||||
|
|
||||||
|
try {
|
||||||
|
await gZenPinnedTabManager.editPinnedUrl(tab);
|
||||||
|
|
||||||
|
Assert.equal(
|
||||||
|
tab._zenPinnedInitialState.entry.title,
|
||||||
|
"My Pinned Tab",
|
||||||
|
"An explicit custom label is preserved across a URL edit"
|
||||||
|
);
|
||||||
|
} finally {
|
||||||
|
restorePrompt();
|
||||||
|
favicons.restore();
|
||||||
|
delete tab.zenStaticLabel;
|
||||||
|
await BrowserTestUtils.removeTab(tab);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
add_task(async function test_EditPinnedUrl_KeepsCustomIcon() {
|
||||||
|
const tab = await pinTab("https://example.com/1");
|
||||||
|
const customIcon = "data:image/svg+xml,custom-icon";
|
||||||
|
tab.zenStaticIcon = customIcon;
|
||||||
|
const restorePrompt = mockPrompt("https://example.org/edited");
|
||||||
|
const favicons = mockFavicons("data:image/png;base64,iVBORw0KGgo=");
|
||||||
|
|
||||||
|
try {
|
||||||
|
await gZenPinnedTabManager.editPinnedUrl(tab);
|
||||||
|
|
||||||
|
Assert.equal(
|
||||||
|
tab._zenPinnedInitialState.entry.url,
|
||||||
|
"https://example.org/edited",
|
||||||
|
"The pinned URL should still be updated when a custom icon is set"
|
||||||
|
);
|
||||||
|
Assert.equal(
|
||||||
|
tab._zenPinnedInitialState.image,
|
||||||
|
customIcon,
|
||||||
|
"A user-set custom icon should be preserved, not overridden by a favicon"
|
||||||
|
);
|
||||||
|
Assert.equal(
|
||||||
|
favicons.mock.callCount,
|
||||||
|
0,
|
||||||
|
"Favicon lookup should be skipped when a custom icon is set"
|
||||||
|
);
|
||||||
|
} finally {
|
||||||
|
restorePrompt();
|
||||||
|
favicons.restore();
|
||||||
|
delete tab.zenStaticIcon;
|
||||||
|
await BrowserTestUtils.removeTab(tab);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
add_task(async function test_EditPinnedUrl_InvalidUrlKeepsState() {
|
||||||
|
const tab = await pinTab("https://example.com/1");
|
||||||
|
const originalUrl = tab._zenPinnedInitialState.entry.url;
|
||||||
|
const restorePrompt = mockPrompt(" "); // whitespace only -> not a valid URL
|
||||||
|
const favicons = mockFavicons("data:image/png;base64,iVBORw0KGgo=");
|
||||||
|
|
||||||
|
try {
|
||||||
|
await gZenPinnedTabManager.editPinnedUrl(tab);
|
||||||
|
|
||||||
|
Assert.equal(
|
||||||
|
tab._zenPinnedInitialState.entry.url,
|
||||||
|
originalUrl,
|
||||||
|
"The pinned URL should be unchanged for invalid input"
|
||||||
|
);
|
||||||
|
ok(
|
||||||
|
!tab.hasAttribute("zen-pinned-changed"),
|
||||||
|
"The tab should not be marked as changed for invalid input"
|
||||||
|
);
|
||||||
|
} finally {
|
||||||
|
restorePrompt();
|
||||||
|
favicons.restore();
|
||||||
|
await BrowserTestUtils.removeTab(tab);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
add_task(async function test_EditPinnedUrl_CancelKeepsState() {
|
||||||
|
const tab = await pinTab("https://example.com/1");
|
||||||
|
const originalUrl = tab._zenPinnedInitialState.entry.url;
|
||||||
|
const restorePrompt = mockPrompt(null); // user cancels the dialog
|
||||||
|
|
||||||
|
try {
|
||||||
|
await gZenPinnedTabManager.editPinnedUrl(tab);
|
||||||
|
|
||||||
|
Assert.equal(
|
||||||
|
tab._zenPinnedInitialState.entry.url,
|
||||||
|
originalUrl,
|
||||||
|
"The pinned URL should be unchanged when the dialog is cancelled"
|
||||||
|
);
|
||||||
|
} finally {
|
||||||
|
restorePrompt();
|
||||||
|
await BrowserTestUtils.removeTab(tab);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
add_task(async function test_EditPinnedUrl_FixesSchemeTypo() {
|
||||||
|
const tab = await pinTab("https://example.com/1");
|
||||||
|
const restorePrompt = mockPrompt("htps://example.org/typo");
|
||||||
|
const favicons = mockFavicons("data:image/png;base64,iVBORw0KGgo=");
|
||||||
|
|
||||||
|
try {
|
||||||
|
await gZenPinnedTabManager.editPinnedUrl(tab);
|
||||||
|
|
||||||
|
Assert.equal(
|
||||||
|
tab._zenPinnedInitialState.entry.url,
|
||||||
|
"https://example.org/typo",
|
||||||
|
"A mistyped scheme (htps://) should be auto-fixed to https://"
|
||||||
|
);
|
||||||
|
} finally {
|
||||||
|
restorePrompt();
|
||||||
|
favicons.restore();
|
||||||
|
await BrowserTestUtils.removeTab(tab);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
add_task(async function test_EditPinnedUrl_AddsMissingScheme() {
|
||||||
|
const tab = await pinTab("https://example.com/1");
|
||||||
|
const restorePrompt = mockPrompt("example.org/no-scheme");
|
||||||
|
const favicons = mockFavicons("data:image/png;base64,iVBORw0KGgo=");
|
||||||
|
|
||||||
|
try {
|
||||||
|
await gZenPinnedTabManager.editPinnedUrl(tab);
|
||||||
|
|
||||||
|
const stored = tab._zenPinnedInitialState.entry.url;
|
||||||
|
ok(
|
||||||
|
/^https?:\/\//.test(stored),
|
||||||
|
`A scheme should be prepended when omitted (got "${stored}")`
|
||||||
|
);
|
||||||
|
ok(
|
||||||
|
stored.endsWith("example.org/no-scheme"),
|
||||||
|
`Host and path should be preserved (got "${stored}")`
|
||||||
|
);
|
||||||
|
} finally {
|
||||||
|
restorePrompt();
|
||||||
|
favicons.restore();
|
||||||
|
await BrowserTestUtils.removeTab(tab);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
add_task(async function test_EditPinnedUrl_PrefillsWithStoredUrl() {
|
||||||
|
const tab = await pinTab("https://example.com/1");
|
||||||
|
// The stored pinned URL differs from the live browser URL (e.g. it was pinned
|
||||||
|
// as http but the server redirected the tab to https).
|
||||||
|
tab._zenPinnedInitialState = {
|
||||||
|
entry: { url: "http://example.com/pinned" },
|
||||||
|
image: "",
|
||||||
|
};
|
||||||
|
|
||||||
|
let prefilled;
|
||||||
|
const originalPrompt = Services.prompt;
|
||||||
|
Services.prompt = {
|
||||||
|
QueryInterface: ChromeUtils.generateQI([Ci.nsIPromptService]),
|
||||||
|
prompt(win, title, label, result) {
|
||||||
|
prefilled = result.value;
|
||||||
|
return false; // cancel, we only care about the prefilled value
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
await gZenPinnedTabManager.editPinnedUrl(tab);
|
||||||
|
|
||||||
|
Assert.equal(
|
||||||
|
prefilled,
|
||||||
|
"http://example.com/pinned",
|
||||||
|
"The edit dialog should prefill with the stored pinned URL, not the live browser URL"
|
||||||
|
);
|
||||||
|
} finally {
|
||||||
|
Services.prompt = originalPrompt;
|
||||||
|
await BrowserTestUtils.removeTab(tab);
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -5,8 +5,8 @@
|
|||||||
"binaryName": "zen",
|
"binaryName": "zen",
|
||||||
"version": {
|
"version": {
|
||||||
"product": "firefox",
|
"product": "firefox",
|
||||||
"version": "152.0.1",
|
"version": "152.0.3",
|
||||||
"candidate": "152.0.1",
|
"candidate": "152.0.3",
|
||||||
"candidateBuild": 1
|
"candidateBuild": 1
|
||||||
},
|
},
|
||||||
"buildOptions": {
|
"buildOptions": {
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
"brandShortName": "Zen",
|
"brandShortName": "Zen",
|
||||||
"brandFullName": "Zen Browser",
|
"brandFullName": "Zen Browser",
|
||||||
"release": {
|
"release": {
|
||||||
"displayVersion": "1.21.3b",
|
"displayVersion": "1.21.4b",
|
||||||
"github": {
|
"github": {
|
||||||
"repo": "zen-browser/desktop"
|
"repo": "zen-browser/desktop"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user