Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 33 additions & 23 deletions src/browser/components/urlbar/content/UrlbarInput-mjs.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/browser/components/urlbar/content/UrlbarInput.mjs b/browser/components/urlbar/content/UrlbarInput.mjs
index 2e6e2be9d7e28c3f189131ec19a26d552d13af99..101b5a3a70c24f28a755f2ca6630a6bc6b01181b 100644
index 2e6e2be9d7e28c3f189131ec19a26d552d13af99..c17b4553829854340ef512dcb90bfd387069c8da 100644
--- a/browser/components/urlbar/content/UrlbarInput.mjs
+++ b/browser/components/urlbar/content/UrlbarInput.mjs
@@ -68,6 +68,13 @@ const lazy = XPCOMUtils.declareLazy({
Expand Down Expand Up @@ -75,7 +75,7 @@ index 2e6e2be9d7e28c3f189131ec19a26d552d13af99..101b5a3a70c24f28a755f2ca6630a6bc
}

if (isCanonized) {
@@ -2598,6 +2630,32 @@ export class UrlbarInput extends HTMLElement {
@@ -2598,6 +2630,42 @@ export class UrlbarInput extends HTMLElement {
await this.#updateLayoutBreakoutDimensions();
}

Expand All @@ -92,9 +92,19 @@ index 2e6e2be9d7e28c3f189131ec19a26d552d13af99..101b5a3a70c24f28a755f2ca6630a6bc
+
+ get zenStrippedURI() {
+ let strippedURI = null;
+ let activeBrowser = this.window.gBrowser?.selectedBrowser;
+ let uriString = activeBrowser.userTypedValue ||
+ (activeBrowser.currentURI ? activeBrowser.currentURI.spec : "");
+
+ let uri;
+ try {
+ uri = Services.io.newURI(uriString);
+ } catch (e) {
+ // Fallback if the provisional string isn't a valid URI yet
+ uri = activeBrowser.currentURI;
+ }
+
+ // Error check occurs during isClipboardURIValid
+ let uri = this.window.gBrowser.currentURI;
+ try {
+ strippedURI = lazy.QueryStringStripper.stripForCopyOrShare(uri);
+ } catch (e) {
Expand All @@ -108,7 +118,7 @@ index 2e6e2be9d7e28c3f189131ec19a26d552d13af99..101b5a3a70c24f28a755f2ca6630a6bc
startLayoutExtend() {
if (!this.#allowBreakout || this.hasAttribute("breakout-extend")) {
// Do not expand if the Urlbar does not support being expanded or it is
@@ -2612,6 +2670,13 @@ export class UrlbarInput extends HTMLElement {
@@ -2612,6 +2680,13 @@ export class UrlbarInput extends HTMLElement {

this.setAttribute("breakout-extend", "true");

Expand All @@ -122,7 +132,7 @@ index 2e6e2be9d7e28c3f189131ec19a26d552d13af99..101b5a3a70c24f28a755f2ca6630a6bc
// Enable the animation only after the first extend call to ensure it
// doesn't run when opening a new window.
if (!this.hasAttribute("breakout-extend-animate")) {
@@ -2631,6 +2696,27 @@ export class UrlbarInput extends HTMLElement {
@@ -2631,6 +2706,27 @@ export class UrlbarInput extends HTMLElement {
return;
}

Expand Down Expand Up @@ -150,7 +160,7 @@ index 2e6e2be9d7e28c3f189131ec19a26d552d13af99..101b5a3a70c24f28a755f2ca6630a6bc
this.removeAttribute("breakout-extend");
this.#updateTextboxPosition();
}
@@ -2661,7 +2747,7 @@ export class UrlbarInput extends HTMLElement {
@@ -2661,7 +2757,7 @@ export class UrlbarInput extends HTMLElement {
forceUnifiedSearchButtonAvailable = false
) {
let prevState = this.getAttribute("pageproxystate");
Expand All @@ -159,7 +169,7 @@ index 2e6e2be9d7e28c3f189131ec19a26d552d13af99..101b5a3a70c24f28a755f2ca6630a6bc
this.setAttribute("pageproxystate", state);
this._inputContainer.setAttribute("pageproxystate", state);
this._identityBox?.setAttribute("pageproxystate", state);
@@ -2915,10 +3001,12 @@ export class UrlbarInput extends HTMLElement {
@@ -2915,10 +3011,12 @@ export class UrlbarInput extends HTMLElement {
return;
}
this.style.top = px(
Expand All @@ -172,7 +182,7 @@ index 2e6e2be9d7e28c3f189131ec19a26d552d13af99..101b5a3a70c24f28a755f2ca6630a6bc
);
}

@@ -2977,9 +3065,10 @@ export class UrlbarInput extends HTMLElement {
@@ -2977,9 +3075,10 @@ export class UrlbarInput extends HTMLElement {
return;
}

Expand All @@ -184,15 +194,15 @@ index 2e6e2be9d7e28c3f189131ec19a26d552d13af99..101b5a3a70c24f28a755f2ca6630a6bc
);
this.style.setProperty(
"--urlbar-height",
@@ -3413,6 +3502,7 @@ export class UrlbarInput extends HTMLElement {
@@ -3413,6 +3512,7 @@ export class UrlbarInput extends HTMLElement {
}

_toggleActionOverride(event) {
+ if (!Services.prefs.getBoolPref("zen.urlbar.enable-overrides")) return;
if (
event.keyCode == KeyEvent.DOM_VK_SHIFT ||
event.keyCode == KeyEvent.DOM_VK_ALT ||
@@ -3516,8 +3606,8 @@ export class UrlbarInput extends HTMLElement {
@@ -3516,8 +3616,8 @@ export class UrlbarInput extends HTMLElement {
if (!this.#isAddressbar) {
return val;
}
Expand All @@ -203,15 +213,15 @@ index 2e6e2be9d7e28c3f189131ec19a26d552d13af99..101b5a3a70c24f28a755f2ca6630a6bc
: val;
// Only trim value if the directionality doesn't change to RTL and we're not
// showing a strikeout https protocol.
@@ -3824,6 +3914,7 @@ export class UrlbarInput extends HTMLElement {
@@ -3824,6 +3924,7 @@ export class UrlbarInput extends HTMLElement {
resultDetails = null,
browser = this.window.gBrowser.selectedBrowser
) {
+ openUILinkWhere = this.window.gZenUIManager.getOpenUILinkWhere(url, browser, openUILinkWhere);
if (this.#isAddressbar) {
this.#prepareAddressbarLoad(
url,
@@ -3935,6 +4026,10 @@ export class UrlbarInput extends HTMLElement {
@@ -3935,6 +4036,10 @@ export class UrlbarInput extends HTMLElement {
}
reuseEmpty = true;
}
Expand All @@ -222,7 +232,7 @@ index 2e6e2be9d7e28c3f189131ec19a26d552d13af99..101b5a3a70c24f28a755f2ca6630a6bc
if (
where == "tab" &&
reuseEmpty &&
@@ -3942,6 +4037,9 @@ export class UrlbarInput extends HTMLElement {
@@ -3942,6 +4047,9 @@ export class UrlbarInput extends HTMLElement {
) {
where = "current";
}
Expand All @@ -232,23 +242,23 @@ index 2e6e2be9d7e28c3f189131ec19a26d552d13af99..101b5a3a70c24f28a755f2ca6630a6bc
return where;
}

@@ -4196,6 +4294,7 @@ export class UrlbarInput extends HTMLElement {
@@ -4196,6 +4304,7 @@ export class UrlbarInput extends HTMLElement {
this.setResultForCurrentValue(null);
this.handleCommand();
this.controller.clearLastQueryContextCache();
+ this.view.close();

this._suppressStartQuery = false;
});
@@ -4203,7 +4302,6 @@ export class UrlbarInput extends HTMLElement {
@@ -4203,7 +4312,6 @@ export class UrlbarInput extends HTMLElement {
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.
- this.view.close();

let controller =
this.document.commandDispatcher.getControllerForCommand("cmd_paste");
@@ -4319,7 +4417,11 @@ export class UrlbarInput extends HTMLElement {
@@ -4319,7 +4427,11 @@ export class UrlbarInput extends HTMLElement {
if (!engineName && !source && !this.hasAttribute("searchmode")) {
return;
}
Expand All @@ -261,15 +271,15 @@ index 2e6e2be9d7e28c3f189131ec19a26d552d13af99..101b5a3a70c24f28a755f2ca6630a6bc
if (this._searchModeIndicatorTitle) {
this._searchModeIndicatorTitle.textContent = "";
this._searchModeIndicatorTitle.removeAttribute("data-l10n-id");
@@ -4629,6 +4731,7 @@ export class UrlbarInput extends HTMLElement {
@@ -4629,6 +4741,7 @@ export class UrlbarInput extends HTMLElement {

this.document.l10n.setAttributes(
this.inputField,
+ this.window.gZenVerticalTabsManager._hasSetSingleToolbar ? 'zen-singletoolbar-urlbar-placeholder-with-name' :
l10nId,
l10nId == "urlbar-placeholder-with-name"
? { name: engineName }
@@ -4742,6 +4845,11 @@ export class UrlbarInput extends HTMLElement {
@@ -4742,6 +4855,11 @@ export class UrlbarInput extends HTMLElement {
}

_on_click(event) {
Expand All @@ -281,7 +291,7 @@ index 2e6e2be9d7e28c3f189131ec19a26d552d13af99..101b5a3a70c24f28a755f2ca6630a6bc
switch (event.target) {
case this.inputField:
case this._inputContainer:
@@ -4820,7 +4928,7 @@ export class UrlbarInput extends HTMLElement {
@@ -4820,7 +4938,7 @@ export class UrlbarInput extends HTMLElement {
}
}

Expand All @@ -290,7 +300,7 @@ index 2e6e2be9d7e28c3f189131ec19a26d552d13af99..101b5a3a70c24f28a755f2ca6630a6bc
this.view.autoOpen({ event });
} else {
if (this._untrimOnFocusAfterKeydown) {
@@ -4860,9 +4968,16 @@ export class UrlbarInput extends HTMLElement {
@@ -4860,9 +4978,16 @@ export class UrlbarInput extends HTMLElement {
}

_on_mousedown(event) {
Expand All @@ -308,7 +318,7 @@ index 2e6e2be9d7e28c3f189131ec19a26d552d13af99..101b5a3a70c24f28a755f2ca6630a6bc
if (
event.composedTarget != this.inputField &&
event.composedTarget != this._inputContainer
@@ -4872,6 +4987,10 @@ export class UrlbarInput extends HTMLElement {
@@ -4872,6 +4997,10 @@ export class UrlbarInput extends HTMLElement {

this.focusedViaMousedown = !this.focused;
this._preventClickSelectsAll = this.focused;
Expand All @@ -319,7 +329,7 @@ index 2e6e2be9d7e28c3f189131ec19a26d552d13af99..101b5a3a70c24f28a755f2ca6630a6bc

// Keep the focus status, since the attribute may be changed
// upon calling this.focus().
@@ -4907,7 +5026,7 @@ export class UrlbarInput extends HTMLElement {
@@ -4907,7 +5036,7 @@ export class UrlbarInput extends HTMLElement {
}
// 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.
Expand All @@ -328,7 +338,7 @@ index 2e6e2be9d7e28c3f189131ec19a26d552d13af99..101b5a3a70c24f28a755f2ca6630a6bc
break;
}

@@ -5235,7 +5354,7 @@ export class UrlbarInput extends HTMLElement {
@@ -5235,7 +5364,7 @@ export class UrlbarInput extends HTMLElement {
// When we are in actions search mode we can show more results so
// increase the limit.
let maxResults =
Expand Down