feat: Added zen.tabs.open-pinned-in-new-tab pref, b=no-bug, c=common, compact-mode, folders

This commit is contained in:
Mr. M
2025-08-23 19:58:40 +02:00
parent b29a2bf7d8
commit 9dff069011
6 changed files with 51 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/urlbar/UrlbarInput.sys.mjs b/browser/components/urlbar/UrlbarInput.sys.mjs
index db1a780f36d16c1b63ad50af76887b16e88ca8fe..7feb0444d8628dd1aa3a4fa99b439b4a45dcb08d 100644
index db1a780f36d16c1b63ad50af76887b16e88ca8fe..440ef03a7a43d6848c371fbe0cac62cfca59af8e 100644
--- a/browser/components/urlbar/UrlbarInput.sys.mjs
+++ b/browser/components/urlbar/UrlbarInput.sys.mjs
@@ -68,6 +68,13 @@ XPCOMUtils.defineLazyPreferenceGetter(
@@ -166,7 +166,15 @@ index db1a780f36d16c1b63ad50af76887b16e88ca8fe..7feb0444d8628dd1aa3a4fa99b439b4a
: val;
// Only trim value if the directionality doesn't change to RTL and we're not
// showing a strikeout https protocol.
@@ -3459,6 +3522,10 @@ export class UrlbarInput {
@@ -3307,6 +3370,7 @@ export class UrlbarInput {
resultDetails = null,
browser = this.window.gBrowser.selectedBrowser
) {
+ openUILinkWhere = this.window.gZenUIManager.getOpenUILinkWhere(url, browser, openUILinkWhere);
// No point in setting these because we'll handleRevert() a few rows below.
if (openUILinkWhere == "current") {
// Make sure URL is formatted properly (don't show punycode).
@@ -3459,6 +3523,10 @@ export class UrlbarInput {
}
reuseEmpty = true;
}
@@ -177,7 +185,7 @@ index db1a780f36d16c1b63ad50af76887b16e88ca8fe..7feb0444d8628dd1aa3a4fa99b439b4a
if (
where == "tab" &&
reuseEmpty &&
@@ -3466,6 +3533,9 @@ export class UrlbarInput {
@@ -3466,6 +3534,9 @@ export class UrlbarInput {
) {
where = "current";
}
@@ -187,7 +195,7 @@ index db1a780f36d16c1b63ad50af76887b16e88ca8fe..7feb0444d8628dd1aa3a4fa99b439b4a
return where;
}
@@ -3723,6 +3793,7 @@ export class UrlbarInput {
@@ -3723,6 +3794,7 @@ export class UrlbarInput {
this.setResultForCurrentValue(null);
this.handleCommand();
this.controller.clearLastQueryContextCache();
@@ -195,7 +203,7 @@ index db1a780f36d16c1b63ad50af76887b16e88ca8fe..7feb0444d8628dd1aa3a4fa99b439b4a
this._suppressStartQuery = false;
});
@@ -3730,7 +3801,6 @@ export class UrlbarInput {
@@ -3730,7 +3802,6 @@ export class UrlbarInput {
contextMenu.addEventListener("popupshowing", () => {
// Close the results pane when the input field contextual menu is open,
// because paste and go doesn't want a result selection.
@@ -203,7 +211,7 @@ index db1a780f36d16c1b63ad50af76887b16e88ca8fe..7feb0444d8628dd1aa3a4fa99b439b4a
let controller =
this.document.commandDispatcher.getControllerForCommand("cmd_paste");
@@ -4138,6 +4208,7 @@ export class UrlbarInput {
@@ -4138,6 +4209,7 @@ export class UrlbarInput {
this.document.l10n.setAttributes(
this.inputField,
@@ -211,7 +219,7 @@ index db1a780f36d16c1b63ad50af76887b16e88ca8fe..7feb0444d8628dd1aa3a4fa99b439b4a
l10nId,
l10nId == "urlbar-placeholder-with-name" ? { name } : undefined
);
@@ -4249,6 +4320,11 @@ export class UrlbarInput {
@@ -4249,6 +4321,11 @@ export class UrlbarInput {
}
_on_click(event) {
@@ -223,7 +231,7 @@ index db1a780f36d16c1b63ad50af76887b16e88ca8fe..7feb0444d8628dd1aa3a4fa99b439b4a
if (
event.target == this.inputField ||
event.target == this._inputContainer ||
@@ -4320,7 +4396,7 @@ export class UrlbarInput {
@@ -4320,7 +4397,7 @@ export class UrlbarInput {
}
}
@@ -232,7 +240,7 @@ index db1a780f36d16c1b63ad50af76887b16e88ca8fe..7feb0444d8628dd1aa3a4fa99b439b4a
this.view.autoOpen({ event });
} else {
if (this._untrimOnFocusAfterKeydown) {
@@ -4360,9 +4436,16 @@ export class UrlbarInput {
@@ -4360,9 +4437,16 @@ export class UrlbarInput {
}
_on_mousedown(event) {
@@ -250,7 +258,7 @@ index db1a780f36d16c1b63ad50af76887b16e88ca8fe..7feb0444d8628dd1aa3a4fa99b439b4a
if (
event.target != this.inputField &&
@@ -4374,6 +4457,10 @@ export class UrlbarInput {
@@ -4374,6 +4458,10 @@ export class UrlbarInput {
this.focusedViaMousedown = !this.focused;
this._preventClickSelectsAll = this.focused;
@@ -261,7 +269,7 @@ index db1a780f36d16c1b63ad50af76887b16e88ca8fe..7feb0444d8628dd1aa3a4fa99b439b4a
// Keep the focus status, since the attribute may be changed
// upon calling this.focus().
@@ -4414,7 +4501,7 @@ export class UrlbarInput {
@@ -4414,7 +4502,7 @@ export class UrlbarInput {
}
// Don't close the view when clicking on a tab; we may want to keep the
// view open on tab switch, and the TabSelect event arrived earlier.