mirror of
https://github.com/zen-browser/desktop.git
synced 2026-06-14 15:33:42 +00:00
Merge branch 'dev' of https://github.com/zen-browser/desktop into dev
This commit is contained in:
41
src/browser/components/BrowserContentHandler-sys-mjs.patch
Normal file
41
src/browser/components/BrowserContentHandler-sys-mjs.patch
Normal file
@@ -0,0 +1,41 @@
|
||||
diff --git a/browser/components/BrowserContentHandler.sys.mjs b/browser/components/BrowserContentHandler.sys.mjs
|
||||
index 57a37b5c0d1982ecfff8d94e05fea89895713a58..062dcb0d1de00982bd777c3dc5d62a88a304bc68 100644
|
||||
--- a/browser/components/BrowserContentHandler.sys.mjs
|
||||
+++ b/browser/components/BrowserContentHandler.sys.mjs
|
||||
@@ -601,6 +601,28 @@ nsBrowserContentHandler.prototype = {
|
||||
}
|
||||
}
|
||||
|
||||
+ try {
|
||||
+ let blankWindowParam = cmdLine.handleFlagWithParam("blank-window", false);
|
||||
+ if (blankWindowParam !== null) {
|
||||
+ let { uri, principal } = resolveURIInternal(cmdLine, blankWindowParam);
|
||||
+ if (shouldLoadURI(uri)) {
|
||||
+ let win = openBrowserWindow(cmdLine, principal, uri.spec);
|
||||
+ win._zenStartupSyncFlag = 'unsynced';
|
||||
+ cmdLine.preventDefault = true;
|
||||
+ }
|
||||
+ }
|
||||
+ } catch (e) {
|
||||
+ if (e.result != Cr.NS_ERROR_INVALID_ARG) {
|
||||
+ throw e;
|
||||
+ }
|
||||
+ if (cmdLine.handleFlag("blank-window", false)) {
|
||||
+ let win = openBrowserWindow(cmdLine, null, null);
|
||||
+ win._zenStartupSyncFlag = 'unsynced';
|
||||
+ cmdLine.preventDefault = true;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+
|
||||
var searchParam = cmdLine.handleFlagWithParam("search", false);
|
||||
if (searchParam) {
|
||||
doSearch(searchParam, cmdLine);
|
||||
@@ -670,6 +692,7 @@ nsBrowserContentHandler.prototype = {
|
||||
" --new-window <url> Open <url> in a new window.\n" +
|
||||
" --new-tab <url> Open <url> in a new tab.\n" +
|
||||
" --private-window [<url>] Open <url> in a new private window.\n";
|
||||
+ info += " --blank-window [<url>] Open the new blank window.\n";
|
||||
if (AppConstants.platform == "win") {
|
||||
info += " --preferences Open Options dialog.\n";
|
||||
} else {
|
||||
@@ -1,5 +1,5 @@
|
||||
diff --git a/browser/components/sessionstore/SessionStore.sys.mjs b/browser/components/sessionstore/SessionStore.sys.mjs
|
||||
index 2a055f0c5f34f0a2667f659185120c07d38f4e41..2061ef7ac60371a563b4e4cd77ceab586f767a5e 100644
|
||||
index 2a055f0c5f34f0a2667f659185120c07d38f4e41..f52b8ddecf31e258ca33bbaf3483951d2b804210 100644
|
||||
--- a/browser/components/sessionstore/SessionStore.sys.mjs
|
||||
+++ b/browser/components/sessionstore/SessionStore.sys.mjs
|
||||
@@ -127,6 +127,9 @@ const TAB_EVENTS = [
|
||||
@@ -63,6 +63,15 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..2061ef7ac60371a563b4e4cd77ceab58
|
||||
|
||||
// perform additional initialization when the first window is loading
|
||||
if (lazy.RunState.isStopped) {
|
||||
@@ -2088,7 +2097,7 @@ var SessionStoreInternal = {
|
||||
// to disk to NOW() to enforce a full interval before the next write.
|
||||
lazy.SessionSaver.updateLastSaveTime();
|
||||
|
||||
- if (isPrivateWindow || isTaskbarTab) {
|
||||
+ if (isPrivateWindow || isTaskbarTab || aWindow.document.documentElement.hasAttribute("zen-unsynced-window")) {
|
||||
this._log.debug(
|
||||
"initializeWindow, the window is private or a web app. Saving SessionStartup.state for possibly restoring later"
|
||||
);
|
||||
@@ -2131,6 +2140,7 @@ var SessionStoreInternal = {
|
||||
null,
|
||||
"sessionstore-one-or-no-tab-restored"
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
diff --git a/browser/components/urlbar/UrlbarMuxerStandard.sys.mjs b/browser/components/urlbar/UrlbarMuxerStandard.sys.mjs
|
||||
index c12d875172650dddfe7de623a776149517c83302..66e923ed2c84e350dd7ba7a20e362666cec8f307 100644
|
||||
index c12d875172650dddfe7de623a776149517c83302..de24df54f510c44acda8c64584bf483a2cb5650a 100644
|
||||
--- a/browser/components/urlbar/UrlbarMuxerStandard.sys.mjs
|
||||
+++ b/browser/components/urlbar/UrlbarMuxerStandard.sys.mjs
|
||||
@@ -854,6 +854,7 @@ class MuxerUnifiedComplete extends UrlbarMuxer {
|
||||
@@ -849,11 +849,16 @@ class MuxerUnifiedComplete extends UrlbarMuxer {
|
||||
result.providerName == "UrlbarProviderHeuristicFallback" &&
|
||||
state.context.heuristicResult?.providerName !=
|
||||
"UrlbarProviderHeuristicFallback"
|
||||
+ && !(
|
||||
+ result.type == UrlbarUtils.RESULT_TYPE.SEARCH &&
|
||||
+ state.context.heuristicResult?.type == UrlbarUtils.RESULT_TYPE.URL
|
||||
+ )
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (result.providerName == "UrlbarProviderTabToSearch") {
|
||||
@@ -10,7 +19,7 @@ index c12d875172650dddfe7de623a776149517c83302..66e923ed2c84e350dd7ba7a20e362666
|
||||
// Discard the result if a tab-to-search result was added already.
|
||||
if (!state.canAddTabToSearch) {
|
||||
return false;
|
||||
@@ -1500,7 +1501,9 @@ class MuxerUnifiedComplete extends UrlbarMuxer {
|
||||
@@ -1500,7 +1505,9 @@ class MuxerUnifiedComplete extends UrlbarMuxer {
|
||||
usedLimits.maxResultCount++;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
diff --git a/browser/components/urlbar/UrlbarProviderHeuristicFallback.sys.mjs b/browser/components/urlbar/UrlbarProviderHeuristicFallback.sys.mjs
|
||||
index 7a60a871022df44c0d26745f0035fce988cc5f92..0b89f9b66573d4c5ffb67983d728bb593e5cb524 100644
|
||||
--- a/browser/components/urlbar/UrlbarProviderHeuristicFallback.sys.mjs
|
||||
+++ b/browser/components/urlbar/UrlbarProviderHeuristicFallback.sys.mjs
|
||||
@@ -75,22 +75,26 @@ export class UrlbarProviderHeuristicFallback extends UrlbarProvider {
|
||||
// Since we can't tell if this is a real URL and whether the user wants
|
||||
// to visit or search for it, we provide an alternative searchengine
|
||||
// match if the string looks like an alphanumeric origin or an e-mail.
|
||||
- let str = queryContext.searchString;
|
||||
- if (!URL.canParse(str)) {
|
||||
- if (
|
||||
- lazy.UrlbarPrefs.get("keyword.enabled") &&
|
||||
- (lazy.UrlUtils.looksLikeOrigin(str, {
|
||||
- noIp: true,
|
||||
- noPort: true,
|
||||
- }) ||
|
||||
- lazy.UrlUtils.REGEXP_COMMON_EMAIL.test(str))
|
||||
- ) {
|
||||
+ let trimmedSearchString = queryContext.trimmedSearchString;
|
||||
+ let [searchCandidate] = UrlbarUtils.stripPrefixAndTrim(
|
||||
+ trimmedSearchString,
|
||||
+ {
|
||||
+ trimSlash: true,
|
||||
+ }
|
||||
+ );
|
||||
+ if (
|
||||
+ lazy.UrlbarPrefs.get("keyword.enabled") &&
|
||||
+ (lazy.UrlUtils.looksLikeUrl(searchCandidate) ||
|
||||
+ lazy.UrlUtils.looksLikeOrigin(searchCandidate, {
|
||||
+ allowPartialNumericalTLDs: true,
|
||||
+ }) !== lazy.UrlUtils.LOOKS_LIKE_ORIGIN.NONE ||
|
||||
+ lazy.UrlUtils.REGEXP_COMMON_EMAIL.test(trimmedSearchString))
|
||||
+ ) {
|
||||
let searchResult = await this._engineSearchResult({ queryContext });
|
||||
if (instance != this.queryInstance) {
|
||||
return;
|
||||
}
|
||||
addCallback(this, searchResult);
|
||||
- }
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
# 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/.
|
||||
|
||||
MOZ_SRC_FILES += [
|
||||
EXTRA_JS_MODULES += [
|
||||
"sys/ZenActorsManager.sys.mjs",
|
||||
"sys/ZenCustomizableUI.sys.mjs",
|
||||
"sys/ZenUIMigration.sys.mjs",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# 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/.
|
||||
|
||||
MOZ_SRC_FILES += [
|
||||
EXTRA_JS_MODULES.zen += [
|
||||
"ZenSessionManager.sys.mjs",
|
||||
"ZenWindowSync.sys.mjs",
|
||||
]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# 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/.
|
||||
|
||||
MOZ_SRC_FILES += [
|
||||
EXTRA_JS_MODULES += [
|
||||
"ZenSiteDataPanel.sys.mjs",
|
||||
"ZenUBActionsProvider.sys.mjs",
|
||||
"ZenUBGlobalActions.sys.mjs",
|
||||
|
||||
@@ -144,6 +144,10 @@ export class nsZenWorkspace extends MozXULElement {
|
||||
this.pinnedTabsContainer.scrollbox = this.scrollbox;
|
||||
this.#initialPinnedElementChildrenCount = this.pinnedTabsContainer.children.length;
|
||||
|
||||
if (document.documentElement.hasAttribute("zen-unsynced-window")) {
|
||||
this.indicator.removeAttribute("context");
|
||||
}
|
||||
|
||||
this.indicator
|
||||
.querySelector(".zen-workspaces-actions")
|
||||
.addEventListener("click", this.onActionsCommand.bind(this));
|
||||
|
||||
Reference in New Issue
Block a user