mirror of
https://github.com/zen-browser/desktop.git
synced 2026-05-27 15:25:09 +00:00
Compare commits
46 Commits
space-rout
...
1.18.9b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a8e245b28a | ||
|
|
a30ddc98bd | ||
|
|
6273313ce3 | ||
|
|
dd26ec1171 | ||
|
|
1d2a14f9e4 | ||
|
|
5be2ffa418 | ||
|
|
a30798a275 | ||
|
|
214fd4aff0 | ||
|
|
ddd7f165bf | ||
|
|
ae5f9060d4 | ||
|
|
362764f497 | ||
|
|
083f388176 | ||
|
|
813fc16986 | ||
|
|
86a9c17acd | ||
|
|
3d0bdbc71b | ||
|
|
119bedce30 | ||
|
|
1493c6be21 | ||
|
|
4d4d6970e3 | ||
|
|
3914d33968 | ||
|
|
c4f98b0cd8 | ||
|
|
6e728d0e2f | ||
|
|
3bd1101f7b | ||
|
|
c55126085b | ||
|
|
9a6db5fb86 | ||
|
|
8274718d0d | ||
|
|
5511defb1e | ||
|
|
894fbd6a4f | ||
|
|
5a26cb6601 | ||
|
|
2eb09f092c | ||
|
|
66081e97f6 | ||
|
|
08873b0ce7 | ||
|
|
6dce6d60e9 | ||
|
|
302e321da6 | ||
|
|
5d5d51c6f3 | ||
|
|
262209f5a3 | ||
|
|
aa4aae9e26 | ||
|
|
827b89d4e8 | ||
|
|
a1e7af81cc | ||
|
|
1db7e19037 | ||
|
|
c7db15fe9d | ||
|
|
502d3f7d94 | ||
|
|
bd0651165c | ||
|
|
af4f336bf5 | ||
|
|
bffc16ba29 | ||
|
|
7c53549076 | ||
|
|
0fe3a4af10 |
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@@ -368,7 +368,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
arch: [x86_64, aarch64]
|
||||
needs: [linux]
|
||||
needs: [linux, build-data]
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
@@ -406,6 +406,8 @@ jobs:
|
||||
sed -i -e 's/StartupWMClass=zen/StartupWMClass=zen-twilight/g' build/AppDir/zen.desktop
|
||||
fi
|
||||
|
||||
sed -i -e 's/\$VERSION/${{ needs.build-data.outputs.version }}/g' build/AppDir/zen.desktop
|
||||
|
||||
APPDIR=build/AppDir
|
||||
tar -xvf *.tar.* && rm -rf *.tar.*
|
||||
mv zen/* $APPDIR/
|
||||
|
||||
1
.github/workflows/linux-release-build.yml
vendored
1
.github/workflows/linux-release-build.yml
vendored
@@ -92,7 +92,6 @@ jobs:
|
||||
|
||||
- name: Fix Rust version
|
||||
run: |
|
||||
# Install a rust version compatible with LLVM 18
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain $(cat .rust-toolchain)
|
||||
source $HOME/.cargo/env
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.83
|
||||
1.89
|
||||
@@ -34,8 +34,8 @@ Zen is a firefox-based browser with the aim of pushing your productivity to a ne
|
||||
|
||||
### Firefox Versions
|
||||
|
||||
- [`Release`](https://zen-browser.app/download) - Is currently built using Firefox version `147.0.3`! 🚀
|
||||
- [`Twilight`](https://zen-browser.app/download?twilight) - Is currently built using Firefox version `RC 147.0.3`!
|
||||
- [`Release`](https://zen-browser.app/download) - Is currently built using Firefox version `147.0.4`! 🚀
|
||||
- [`Twilight`](https://zen-browser.app/download?twilight) - Is currently built using Firefox version `RC 147.0.4`!
|
||||
|
||||
### Contributing
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ Terminal=false
|
||||
X-MultipleArgs=false
|
||||
Keywords=Internet;WWW;Browser;Web;Explorer;
|
||||
Actions=new-window;new-private-window;profilemanager;
|
||||
X-AppImage-Version=$VERSION
|
||||
|
||||
[Desktop Action new-window]
|
||||
Name=Open a New Window
|
||||
|
||||
@@ -25,6 +25,7 @@ finish-args:
|
||||
- --filesystem=xdg-run/speech-dispatcher:ro
|
||||
- --device=all
|
||||
- --talk-name=org.freedesktop.FileManager1
|
||||
- --talk-name=org.freedesktop.Notifications
|
||||
- --system-talk-name=org.freedesktop.NetworkManager
|
||||
- --talk-name=org.a11y.Bus
|
||||
- --talk-name=org.gtk.vfs.*
|
||||
@@ -62,12 +63,6 @@ modules:
|
||||
strip-components: 0
|
||||
only-arches:
|
||||
- x86_64
|
||||
x-checker-data:
|
||||
type: json
|
||||
url: https://api.github.com/repos/zen-browser/desktop/releases/latest
|
||||
version-query: .tag_name
|
||||
url-query: .assets[] | select(.name=="zen.linux-x86_64.tar.xz") | .browser_download_url
|
||||
is-main-source: true
|
||||
|
||||
- type: archive
|
||||
url: https://github.com/zen-browser/desktop/releases/download/{version}/zen.linux-aarch64.tar.xz
|
||||
@@ -75,12 +70,6 @@ modules:
|
||||
strip-components: 0
|
||||
only-arches:
|
||||
- aarch64
|
||||
x-checker-data:
|
||||
type: json
|
||||
url: https://api.github.com/repos/zen-browser/desktop/releases/latest
|
||||
version-query: .tag_name
|
||||
url-query: .assets[] | select(.name=="zen.linux-aarch64.tar.xz") | .browser_download_url
|
||||
is-main-source: true
|
||||
|
||||
- type: archive
|
||||
url: https://github.com/zen-browser/flatpak/releases/download/{version}/archive.tar
|
||||
|
||||
@@ -30,17 +30,11 @@ if test "$ZEN_RELEASE"; then
|
||||
fi
|
||||
|
||||
# Disable DMD and ELF hacks, enable linker lld
|
||||
ac_add_options --disable-dmd
|
||||
ac_add_options --enable-linker=lld
|
||||
ac_add_options --disable-elf-hack
|
||||
ac_add_options --disable-necko-wifi
|
||||
|
||||
# Stripping options for release builds
|
||||
ac_add_options --enable-install-strip
|
||||
ac_add_options --enable-strip
|
||||
export STRIP_FLAGS="--strip-debug --strip-unneeded"
|
||||
fi
|
||||
|
||||
# Common options
|
||||
ac_add_options --enable-alsa
|
||||
ac_add_options --enable-pulseaudio
|
||||
|
||||
@@ -16,7 +16,4 @@ zen-split-link =
|
||||
|
||||
zen-split-view-modifier-header = Split View
|
||||
zen-split-view-modifier-activate-reallocation =
|
||||
.label = Activate reallocation
|
||||
zen-split-view-modifier-enabled-toast = Split view rearrange is ON.
|
||||
zen-split-view-modifier-enabled-toast-description = Drag and drop the view to rearrange. Press Esc to exit.
|
||||
zen-split-view-modifier-disabled-toast = Split view rearrange is OFF.
|
||||
.label = Activate reallocation
|
||||
@@ -6,7 +6,7 @@
|
||||
value: true
|
||||
|
||||
- name: zen.folders.search.hover-delay
|
||||
value: 700 # ms
|
||||
value: 500 # ms
|
||||
|
||||
- name: zen.folders.max-subfolders
|
||||
value: 5
|
||||
|
||||
@@ -56,4 +56,4 @@
|
||||
value: true
|
||||
|
||||
- name: zen.view.overflow-webext-toolbar
|
||||
value: true
|
||||
value: "@IS_TWILIGHT@"
|
||||
|
||||
@@ -11,6 +11,7 @@ npm run import
|
||||
IGNORE_FILES=(
|
||||
"shared.nsh"
|
||||
"ignorePrefs.json"
|
||||
"moz.configure"
|
||||
)
|
||||
|
||||
# Recursively find all .patch files in the current directory and its subdirectories
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
diff --git a/browser/base/content/browser-sets.js b/browser/base/content/browser-sets.js
|
||||
index 94a05a510204c027e482fda33deaf3dc0d7471c9..79d37a7c7f29739d3ad2d9f6a3b3b8d638836b10 100644
|
||||
index 94a05a510204c027e482fda33deaf3dc0d7471c9..da7cda8e2708a29cf6cc3bf667240d37ef66ecfb 100644
|
||||
--- a/browser/base/content/browser-sets.js
|
||||
+++ b/browser/base/content/browser-sets.js
|
||||
@@ -266,7 +266,7 @@ document.addEventListener(
|
||||
@@ -11,3 +11,12 @@ index 94a05a510204c027e482fda33deaf3dc0d7471c9..79d37a7c7f29739d3ad2d9f6a3b3b8d6
|
||||
const SIDEBAR_REVAMP_PREF = "sidebar.revamp";
|
||||
const SIDEBAR_REVAMP_ENABLED = Services.prefs.getBoolPref(
|
||||
SIDEBAR_REVAMP_PREF,
|
||||
@@ -304,6 +304,8 @@ document.addEventListener(
|
||||
panel: SidebarController.currentID,
|
||||
opened: SidebarController._state.launcherExpanded,
|
||||
});
|
||||
+ } else {
|
||||
+ SidebarController.toggle();
|
||||
}
|
||||
break;
|
||||
case "key_gotoHistory":
|
||||
|
||||
@@ -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/.
|
||||
|
||||
<panel id="zen-folder-tabs-popup" type="arrow" orient="vertical">
|
||||
<panel id="zen-folder-tabs-popup" type="arrow" orient="vertical" side="left">
|
||||
<hbox class="tabs-list-header" flex="1">
|
||||
<image class="zen-folder-tabs-list-search-icon" src="chrome://global/skin/icons/search-glass.svg"/>
|
||||
<html:input id="zen-folder-tabs-list-search"
|
||||
|
||||
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 {
|
||||
@@ -818,6 +818,13 @@ const zenMissingKeyboardShortcutL10n = {
|
||||
key_accessibility: "zen-devtools-toggle-accessibility-shortcut",
|
||||
};
|
||||
|
||||
var zenIgnoreKeyboardShortcutIDs = [
|
||||
"key_enterFullScreen_old",
|
||||
"key_enterFullScreen_compat",
|
||||
"key_exitFullScreen_old",
|
||||
"key_exitFullScreen_compat",
|
||||
];
|
||||
|
||||
var zenIgnoreKeyboardShortcutL10n = [
|
||||
"zen-full-zoom-reduce-shortcut-alt-b",
|
||||
"zen-full-zoom-reduce-shortcut-alt-a",
|
||||
@@ -888,7 +895,11 @@ var gZenCKSSettings = {
|
||||
|
||||
const labelValue = zenMissingKeyboardShortcutL10n[keyID] ?? l10nID;
|
||||
|
||||
if (zenIgnoreKeyboardShortcutL10n.includes(labelValue) || shortcut.shouldBeEmpty) {
|
||||
if (
|
||||
zenIgnoreKeyboardShortcutIDs.includes(keyID) ||
|
||||
zenIgnoreKeyboardShortcutL10n.includes(labelValue) ||
|
||||
shortcut.shouldBeEmpty
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
diff --git a/browser/components/sessionstore/SessionStartup.sys.mjs b/browser/components/sessionstore/SessionStartup.sys.mjs
|
||||
index 86600ffb5178599ab23270a964064ca657a3283f..97975af7822a157eafe02ec8bbebdf1a6b564ccb 100644
|
||||
index 86600ffb5178599ab23270a964064ca657a3283f..70d7b5c7d69d3700475d663b595052264c67d351 100644
|
||||
--- a/browser/components/sessionstore/SessionStartup.sys.mjs
|
||||
+++ b/browser/components/sessionstore/SessionStartup.sys.mjs
|
||||
@@ -40,6 +40,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
||||
@@ -51,3 +51,13 @@ index 86600ffb5178599ab23270a964064ca657a3283f..97975af7822a157eafe02ec8bbebdf1a
|
||||
}
|
||||
|
||||
return this._resumeSessionEnabled;
|
||||
@@ -354,8 +354,7 @@ export var SessionStartup = {
|
||||
*/
|
||||
willRestore() {
|
||||
return (
|
||||
- this.sessionType == this.RECOVER_SESSION ||
|
||||
- this.sessionType == this.RESUME_SESSION
|
||||
+ true
|
||||
);
|
||||
},
|
||||
|
||||
|
||||
@@ -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..53465df6060e6765e1e4564d340bba5fbefff5ce 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"
|
||||
@@ -192,7 +201,19 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..2061ef7ac60371a563b4e4cd77ceab58
|
||||
userContextId: state.userContextId,
|
||||
skipLoad: true,
|
||||
preferredRemoteType,
|
||||
@@ -5414,7 +5443,7 @@ var SessionStoreInternal = {
|
||||
@@ -5055,9 +5084,10 @@ var SessionStoreInternal = {
|
||||
if (activePageData.title && activePageData.title != activePageData.url) {
|
||||
win.gBrowser.setInitialTabTitle(tab, activePageData.title, {
|
||||
isContentTitle: true,
|
||||
+ _zenChangeLabelFlag: true,
|
||||
});
|
||||
} else {
|
||||
- win.gBrowser.setInitialTabTitle(tab, activePageData.url);
|
||||
+ win.gBrowser.setInitialTabTitle(tab, activePageData.url, { _zenChangeLabelFlag: true });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5414,7 +5444,7 @@ var SessionStoreInternal = {
|
||||
|
||||
for (let i = tabbrowser.pinnedTabCount; i < tabbrowser.tabs.length; i++) {
|
||||
let tab = tabbrowser.tabs[i];
|
||||
@@ -201,7 +222,7 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..2061ef7ac60371a563b4e4cd77ceab58
|
||||
removableTabs.push(tab);
|
||||
}
|
||||
}
|
||||
@@ -5525,7 +5554,7 @@ var SessionStoreInternal = {
|
||||
@@ -5525,7 +5555,7 @@ var SessionStoreInternal = {
|
||||
|
||||
// collect the data for all windows
|
||||
for (ix in this._windows) {
|
||||
@@ -210,7 +231,7 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..2061ef7ac60371a563b4e4cd77ceab58
|
||||
// window data is still in _statesToRestore
|
||||
continue;
|
||||
}
|
||||
@@ -5668,11 +5697,12 @@ var SessionStoreInternal = {
|
||||
@@ -5668,11 +5698,12 @@ var SessionStoreInternal = {
|
||||
}
|
||||
|
||||
let tabbrowser = aWindow.gBrowser;
|
||||
@@ -224,7 +245,7 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..2061ef7ac60371a563b4e4cd77ceab58
|
||||
// update the internal state data for this window
|
||||
for (let tab of tabs) {
|
||||
if (tab == aWindow.FirefoxViewHandler.tab) {
|
||||
@@ -5683,6 +5713,9 @@ var SessionStoreInternal = {
|
||||
@@ -5683,6 +5714,9 @@ var SessionStoreInternal = {
|
||||
tabsData.push(tabData);
|
||||
}
|
||||
|
||||
@@ -234,7 +255,7 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..2061ef7ac60371a563b4e4cd77ceab58
|
||||
// update tab group state for this window
|
||||
winData.groups = [];
|
||||
for (let tabGroup of aWindow.gBrowser.tabGroups) {
|
||||
@@ -5695,7 +5728,7 @@ var SessionStoreInternal = {
|
||||
@@ -5695,7 +5729,7 @@ var SessionStoreInternal = {
|
||||
// a window is closed, point to the first item in the tab strip instead (it will never be the Firefox View tab,
|
||||
// since it's only inserted into the tab strip after it's selected).
|
||||
if (aWindow.FirefoxViewHandler.tab?.selected) {
|
||||
@@ -243,7 +264,7 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..2061ef7ac60371a563b4e4cd77ceab58
|
||||
winData.title = tabbrowser.tabs[0].label;
|
||||
}
|
||||
winData.selected = selectedIndex;
|
||||
@@ -5810,8 +5843,8 @@ var SessionStoreInternal = {
|
||||
@@ -5810,8 +5844,8 @@ var SessionStoreInternal = {
|
||||
// selectTab represents.
|
||||
let selectTab = 0;
|
||||
if (overwriteTabs) {
|
||||
@@ -254,7 +275,7 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..2061ef7ac60371a563b4e4cd77ceab58
|
||||
selectTab = Math.min(selectTab, winData.tabs.length);
|
||||
}
|
||||
|
||||
@@ -5833,6 +5866,7 @@ var SessionStoreInternal = {
|
||||
@@ -5833,6 +5867,7 @@ var SessionStoreInternal = {
|
||||
if (overwriteTabs) {
|
||||
for (let i = tabbrowser.browsers.length - 1; i >= 0; i--) {
|
||||
if (!tabbrowser.tabs[i].selected) {
|
||||
@@ -262,7 +283,7 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..2061ef7ac60371a563b4e4cd77ceab58
|
||||
tabbrowser.removeTab(tabbrowser.tabs[i]);
|
||||
}
|
||||
}
|
||||
@@ -5866,6 +5900,12 @@ var SessionStoreInternal = {
|
||||
@@ -5866,6 +5901,12 @@ var SessionStoreInternal = {
|
||||
savedTabGroup => !openTabGroupIdsInWindow.has(savedTabGroup.id)
|
||||
);
|
||||
}
|
||||
@@ -275,7 +296,7 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..2061ef7ac60371a563b4e4cd77ceab58
|
||||
|
||||
// Move the originally open tabs to the end.
|
||||
if (initialTabs) {
|
||||
@@ -6419,6 +6459,25 @@ var SessionStoreInternal = {
|
||||
@@ -6419,6 +6460,25 @@ var SessionStoreInternal = {
|
||||
|
||||
// Most of tabData has been restored, now continue with restoring
|
||||
// attributes that may trigger external events.
|
||||
@@ -301,7 +322,7 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..2061ef7ac60371a563b4e4cd77ceab58
|
||||
|
||||
if (tabData.pinned) {
|
||||
tabbrowser.pinTab(tab);
|
||||
@@ -6567,6 +6626,9 @@ var SessionStoreInternal = {
|
||||
@@ -6567,6 +6627,9 @@ var SessionStoreInternal = {
|
||||
aWindow.gURLBar.readOnly = false;
|
||||
}
|
||||
}
|
||||
@@ -311,7 +332,7 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..2061ef7ac60371a563b4e4cd77ceab58
|
||||
|
||||
let promiseParts = Promise.withResolvers();
|
||||
aWindow.setTimeout(() => {
|
||||
@@ -7343,7 +7405,7 @@ var SessionStoreInternal = {
|
||||
@@ -7343,7 +7406,7 @@ var SessionStoreInternal = {
|
||||
|
||||
let groupsToSave = new Map();
|
||||
for (let tIndex = 0; tIndex < window.tabs.length; ) {
|
||||
@@ -320,7 +341,7 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..2061ef7ac60371a563b4e4cd77ceab58
|
||||
// Adjust window.selected
|
||||
if (tIndex + 1 < window.selected) {
|
||||
window.selected -= 1;
|
||||
@@ -7358,7 +7420,7 @@ var SessionStoreInternal = {
|
||||
@@ -7358,7 +7421,7 @@ var SessionStoreInternal = {
|
||||
);
|
||||
// We don't want to increment tIndex here.
|
||||
continue;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
diff --git a/browser/components/tabbrowser/TabUnloader.sys.mjs b/browser/components/tabbrowser/TabUnloader.sys.mjs
|
||||
index aefccef39f0b81176a5710a794e8a5e2650d6507..e073c65790df6d55e827a4f4596199f4f1a99a57 100644
|
||||
index aefccef39f0b81176a5710a794e8a5e2650d6507..53c838b3bc322cadee4ef9b411d02fc0af8c35e5 100644
|
||||
--- a/browser/components/tabbrowser/TabUnloader.sys.mjs
|
||||
+++ b/browser/components/tabbrowser/TabUnloader.sys.mjs
|
||||
@@ -52,7 +52,7 @@ let CRITERIA_WEIGHT = 1;
|
||||
@@ -11,3 +11,12 @@ index aefccef39f0b81176a5710a794e8a5e2650d6507..e073c65790df6d55e827a4f4596199f4
|
||||
return weight;
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ let DefaultTabUnloaderMethods = {
|
||||
|
||||
*iterateTabs() {
|
||||
for (let win of Services.wm.getEnumerator("navigator:browser")) {
|
||||
- for (let tab of win.gBrowser.tabs) {
|
||||
+ for (let tab of win.gZenWorkspaces.allStoredTabs) {
|
||||
yield { tab, gBrowser: win.gBrowser };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
|
||||
index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..c7c7e6dd8cacf5d2d13c48ad9bed8195d677420f 100644
|
||||
index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..41cbe295b29abd014cc0425972be45b54fc684d9 100644
|
||||
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
||||
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
||||
@@ -398,6 +398,7 @@
|
||||
@@ -186,11 +186,13 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..c7c7e6dd8cacf5d2d13c48ad9bed8195
|
||||
// If focus is on the old tab, move it to the new tab.
|
||||
if (activeEl == oldTab) {
|
||||
newTab.focus();
|
||||
@@ -1959,6 +2039,11 @@
|
||||
@@ -1958,7 +2038,12 @@
|
||||
return this._setTabLabel(aTab, aLabel);
|
||||
}
|
||||
|
||||
_setTabLabel(aTab, aLabel, { beforeTabOpen, isContentTitle, isURL } = {}) {
|
||||
+ if (!aTab._zenContentsVisible && !aTab._zenChangeLabelFlag && !aTab._labelIsInitialTitle && !gZenWorkspaces.privateWindowOrDisabled) {
|
||||
- _setTabLabel(aTab, aLabel, { beforeTabOpen, isContentTitle, isURL } = {}) {
|
||||
+ _setTabLabel(aTab, aLabel, { beforeTabOpen, isContentTitle, isURL, _zenChangeLabelFlag } = {}) {
|
||||
+ if (!aTab._zenContentsVisible && !aTab._zenChangeLabelFlag && !aTab._labelIsInitialTitle && !gZenWorkspaces.privateWindowOrDisabled && !_zenChangeLabelFlag) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ aLabel = (typeof aTab.zenStaticLabel === "string" && aTab.zenStaticLabel) ? aTab.zenStaticLabel : aLabel;
|
||||
@@ -436,7 +438,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..c7c7e6dd8cacf5d2d13c48ad9bed8195
|
||||
this._fireTabOpen(tab, {});
|
||||
- } else if (tabData.groupId) {
|
||||
+ }
|
||||
+ if (tabData.groupId) {
|
||||
+ if (tabData.groupId && tabGroupWorkingData.get(tabData.groupId)) {
|
||||
let { groupId } = tabData;
|
||||
const tabGroup = tabGroupWorkingData.get(groupId);
|
||||
// if a tab refers to a tab group we don't know, skip any group
|
||||
@@ -468,10 +470,10 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..c7c7e6dd8cacf5d2d13c48ad9bed8195
|
||||
+ gZenWorkspaces._initialTab._shouldRemove = true;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
+ else {
|
||||
+ gZenWorkspaces._tabToRemoveForEmpty = this.selectedTab;
|
||||
}
|
||||
+ }
|
||||
+ this._hasAlreadyInitializedZenSessionStore = true;
|
||||
|
||||
if (tabs.length > 1 || !tabs[0].selected) {
|
||||
@@ -957,16 +959,21 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..c7c7e6dd8cacf5d2d13c48ad9bed8195
|
||||
// Clear tabs cache after moving nodes because the order of tabs may have
|
||||
// changed.
|
||||
this.tabContainer._invalidateCachedTabs();
|
||||
@@ -6869,6 +7096,18 @@
|
||||
@@ -6868,7 +7095,22 @@
|
||||
* @returns {object}
|
||||
* The new tab in the current window, null if the tab couldn't be adopted.
|
||||
*/
|
||||
adoptTab(aTab, { elementIndex, tabIndex, selectTab = false } = {}) {
|
||||
- adoptTab(aTab, { elementIndex, tabIndex, selectTab = false } = {}) {
|
||||
+ adoptTab(aTab, { elementIndex, tabIndex, selectTab = false, spaceId = null } = {}) {
|
||||
+ if (window.gZenWorkspaces.currentWindowIsSyncing && aTab.ownerGlobal.gZenWorkspaces?.currentWindowIsSyncing) {
|
||||
+ const tabId = aTab.id;
|
||||
+ const thisTab = window.gZenWindowSync.getItemFromWindow(window, tabId);
|
||||
+ if (thisTab) {
|
||||
+ // Just move the tab to the index
|
||||
+ this.moveTabTo(thisTab, { elementIndex, tabIndex });
|
||||
+ if (spaceId) {
|
||||
+ thisTab.setAttribute("zen-workspace-id", spaceId);
|
||||
+ }
|
||||
+ if (selectTab) {
|
||||
+ this.selectedTab = thisTab;
|
||||
+ }
|
||||
@@ -976,7 +983,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..c7c7e6dd8cacf5d2d13c48ad9bed8195
|
||||
// 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
|
||||
// windows). We also ensure that the tab we create to swap into has
|
||||
@@ -6910,6 +7149,8 @@
|
||||
@@ -6910,6 +7152,8 @@
|
||||
params.userContextId = aTab.getAttribute("usercontextid");
|
||||
}
|
||||
let newTab = this.addWebTab("about:blank", params);
|
||||
@@ -985,7 +992,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..c7c7e6dd8cacf5d2d13c48ad9bed8195
|
||||
let newBrowser = this.getBrowserForTab(newTab);
|
||||
|
||||
aTab.container.tabDragAndDrop.finishAnimateTabMove();
|
||||
@@ -7718,7 +7959,7 @@
|
||||
@@ -7718,7 +7962,7 @@
|
||||
// preventDefault(). It will still raise the window if appropriate.
|
||||
break;
|
||||
}
|
||||
@@ -994,7 +1001,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..c7c7e6dd8cacf5d2d13c48ad9bed8195
|
||||
window.focus();
|
||||
aEvent.preventDefault();
|
||||
break;
|
||||
@@ -7735,7 +7976,6 @@
|
||||
@@ -7735,7 +7979,6 @@
|
||||
}
|
||||
case "TabGroupCollapse":
|
||||
aEvent.target.tabs.forEach(tab => {
|
||||
@@ -1002,7 +1009,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..c7c7e6dd8cacf5d2d13c48ad9bed8195
|
||||
});
|
||||
break;
|
||||
case "TabGroupCreateByUser":
|
||||
@@ -7895,7 +8135,9 @@
|
||||
@@ -7895,7 +8138,9 @@
|
||||
|
||||
let filter = this._tabFilters.get(tab);
|
||||
if (filter) {
|
||||
@@ -1012,7 +1019,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..c7c7e6dd8cacf5d2d13c48ad9bed8195
|
||||
|
||||
let listener = this._tabListeners.get(tab);
|
||||
if (listener) {
|
||||
@@ -8698,6 +8940,7 @@
|
||||
@@ -8698,6 +8943,7 @@
|
||||
aWebProgress.isTopLevel
|
||||
) {
|
||||
this.mTab.setAttribute("busy", "true");
|
||||
@@ -1020,7 +1027,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..c7c7e6dd8cacf5d2d13c48ad9bed8195
|
||||
gBrowser._tabAttrModified(this.mTab, ["busy"]);
|
||||
this.mTab._notselectedsinceload = !this.mTab.selected;
|
||||
}
|
||||
@@ -8778,6 +9021,7 @@
|
||||
@@ -8778,6 +9024,7 @@
|
||||
// known defaults. Note we use the original URL since about:newtab
|
||||
// redirects to a prerendered page.
|
||||
const shouldRemoveFavicon =
|
||||
@@ -1028,7 +1035,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..c7c7e6dd8cacf5d2d13c48ad9bed8195
|
||||
!this.mBrowser.mIconURL &&
|
||||
!ignoreBlank &&
|
||||
!(originalLocation.spec in FAVICON_DEFAULTS);
|
||||
@@ -9803,7 +10047,7 @@ var TabContextMenu = {
|
||||
@@ -9803,7 +10050,7 @@ var TabContextMenu = {
|
||||
);
|
||||
contextUnpinSelectedTabs.hidden =
|
||||
!this.contextTab.pinned || !this.multiselected;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
diff --git a/browser/components/urlbar/UrlbarUtils.sys.mjs b/browser/components/urlbar/UrlbarUtils.sys.mjs
|
||||
index b97fa81cef276e4bb22414b7c182e00b4bb835dc..1f489eceead0aa331ace59281cb777db5e635366 100644
|
||||
index a4ed35032c0c60f230d95f451b3f615232784cad..2c92860acb2ddc9829eef006d93431e871241c3a 100644
|
||||
--- a/browser/components/urlbar/UrlbarUtils.sys.mjs
|
||||
+++ b/browser/components/urlbar/UrlbarUtils.sys.mjs
|
||||
@@ -81,6 +81,7 @@ export var UrlbarUtils = {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
diff --git a/browser/components/urlbar/content/UrlbarInput.mjs b/browser/components/urlbar/content/UrlbarInput.mjs
|
||||
index edb0482f0bfb22c70a585b0770e5b0437983779e..545f65db4fe8b807b388d5552842cd9e56a72eb3 100644
|
||||
index edb0482f0bfb22c70a585b0770e5b0437983779e..109e9eb18b90c650caff1287caef04dce857e122 100644
|
||||
--- a/browser/components/urlbar/content/UrlbarInput.mjs
|
||||
+++ b/browser/components/urlbar/content/UrlbarInput.mjs
|
||||
@@ -68,6 +68,13 @@ const lazy = XPCOMUtils.declareLazy({
|
||||
@@ -122,14 +122,17 @@ index edb0482f0bfb22c70a585b0770e5b0437983779e..545f65db4fe8b807b388d5552842cd9e
|
||||
// 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")) {
|
||||
@@ -2562,6 +2627,24 @@ export class UrlbarInput extends HTMLElement {
|
||||
@@ -2562,6 +2627,27 @@ export class UrlbarInput extends HTMLElement {
|
||||
return;
|
||||
}
|
||||
|
||||
+ if (this._zenHandleUrlbarClose) {
|
||||
+ this._zenHandleUrlbarClose();
|
||||
+ } else if (!this._untrimmedValue) {
|
||||
+ // Restore the current page URL when the urlbar is empty on blur
|
||||
+ this.handleRevert();
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ // Arc like URLbar: Blur the input on exit
|
||||
+ const zenToolbox = this.document.getElementById("navigator-toolbox");
|
||||
+ this.window.document.documentElement.setAttribute("supress-primary-adjustment", !(
|
||||
@@ -147,7 +150,7 @@ index edb0482f0bfb22c70a585b0770e5b0437983779e..545f65db4fe8b807b388d5552842cd9e
|
||||
this.removeAttribute("breakout-extend");
|
||||
this.#updateTextboxPosition();
|
||||
}
|
||||
@@ -2592,7 +2675,7 @@ export class UrlbarInput extends HTMLElement {
|
||||
@@ -2592,7 +2678,7 @@ export class UrlbarInput extends HTMLElement {
|
||||
forceUnifiedSearchButtonAvailable = false
|
||||
) {
|
||||
let prevState = this.getAttribute("pageproxystate");
|
||||
@@ -156,7 +159,7 @@ index edb0482f0bfb22c70a585b0770e5b0437983779e..545f65db4fe8b807b388d5552842cd9e
|
||||
this.setAttribute("pageproxystate", state);
|
||||
this._inputContainer.setAttribute("pageproxystate", state);
|
||||
this._identityBox?.setAttribute("pageproxystate", state);
|
||||
@@ -2846,10 +2929,12 @@ export class UrlbarInput extends HTMLElement {
|
||||
@@ -2846,10 +2932,12 @@ export class UrlbarInput extends HTMLElement {
|
||||
return;
|
||||
}
|
||||
this.style.top = px(
|
||||
@@ -169,7 +172,7 @@ index edb0482f0bfb22c70a585b0770e5b0437983779e..545f65db4fe8b807b388d5552842cd9e
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2908,9 +2993,10 @@ export class UrlbarInput extends HTMLElement {
|
||||
@@ -2908,9 +2996,10 @@ export class UrlbarInput extends HTMLElement {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -181,7 +184,7 @@ index edb0482f0bfb22c70a585b0770e5b0437983779e..545f65db4fe8b807b388d5552842cd9e
|
||||
);
|
||||
this.style.setProperty(
|
||||
"--urlbar-height",
|
||||
@@ -3344,6 +3430,7 @@ export class UrlbarInput extends HTMLElement {
|
||||
@@ -3344,6 +3433,7 @@ export class UrlbarInput extends HTMLElement {
|
||||
}
|
||||
|
||||
_toggleActionOverride(event) {
|
||||
@@ -189,7 +192,7 @@ index edb0482f0bfb22c70a585b0770e5b0437983779e..545f65db4fe8b807b388d5552842cd9e
|
||||
if (
|
||||
event.keyCode == KeyEvent.DOM_VK_SHIFT ||
|
||||
event.keyCode == KeyEvent.DOM_VK_ALT ||
|
||||
@@ -3447,8 +3534,8 @@ export class UrlbarInput extends HTMLElement {
|
||||
@@ -3447,8 +3537,8 @@ export class UrlbarInput extends HTMLElement {
|
||||
if (!this.#isAddressbar) {
|
||||
return val;
|
||||
}
|
||||
@@ -200,7 +203,7 @@ index edb0482f0bfb22c70a585b0770e5b0437983779e..545f65db4fe8b807b388d5552842cd9e
|
||||
: val;
|
||||
// Only trim value if the directionality doesn't change to RTL and we're not
|
||||
// showing a strikeout https protocol.
|
||||
@@ -3754,6 +3841,7 @@ export class UrlbarInput extends HTMLElement {
|
||||
@@ -3754,6 +3844,7 @@ export class UrlbarInput extends HTMLElement {
|
||||
resultDetails = null,
|
||||
browser = this.window.gBrowser.selectedBrowser
|
||||
) {
|
||||
@@ -208,7 +211,7 @@ index edb0482f0bfb22c70a585b0770e5b0437983779e..545f65db4fe8b807b388d5552842cd9e
|
||||
if (this.#isAddressbar) {
|
||||
this.#prepareAddressbarLoad(
|
||||
url,
|
||||
@@ -3861,6 +3949,10 @@ export class UrlbarInput extends HTMLElement {
|
||||
@@ -3861,6 +3952,10 @@ export class UrlbarInput extends HTMLElement {
|
||||
}
|
||||
reuseEmpty = true;
|
||||
}
|
||||
@@ -219,7 +222,7 @@ index edb0482f0bfb22c70a585b0770e5b0437983779e..545f65db4fe8b807b388d5552842cd9e
|
||||
if (
|
||||
where == "tab" &&
|
||||
reuseEmpty &&
|
||||
@@ -3868,6 +3960,9 @@ export class UrlbarInput extends HTMLElement {
|
||||
@@ -3868,6 +3963,9 @@ export class UrlbarInput extends HTMLElement {
|
||||
) {
|
||||
where = "current";
|
||||
}
|
||||
@@ -229,7 +232,7 @@ index edb0482f0bfb22c70a585b0770e5b0437983779e..545f65db4fe8b807b388d5552842cd9e
|
||||
return where;
|
||||
}
|
||||
|
||||
@@ -4122,6 +4217,7 @@ export class UrlbarInput extends HTMLElement {
|
||||
@@ -4122,6 +4220,7 @@ export class UrlbarInput extends HTMLElement {
|
||||
this.setResultForCurrentValue(null);
|
||||
this.handleCommand();
|
||||
this.controller.clearLastQueryContextCache();
|
||||
@@ -237,7 +240,7 @@ index edb0482f0bfb22c70a585b0770e5b0437983779e..545f65db4fe8b807b388d5552842cd9e
|
||||
|
||||
this._suppressStartQuery = false;
|
||||
});
|
||||
@@ -4129,7 +4225,6 @@ export class UrlbarInput extends HTMLElement {
|
||||
@@ -4129,7 +4228,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.
|
||||
@@ -245,7 +248,7 @@ index edb0482f0bfb22c70a585b0770e5b0437983779e..545f65db4fe8b807b388d5552842cd9e
|
||||
|
||||
let controller =
|
||||
this.document.commandDispatcher.getControllerForCommand("cmd_paste");
|
||||
@@ -4239,7 +4334,11 @@ export class UrlbarInput extends HTMLElement {
|
||||
@@ -4239,7 +4337,11 @@ export class UrlbarInput extends HTMLElement {
|
||||
if (!engineName && !source && !this.hasAttribute("searchmode")) {
|
||||
return;
|
||||
}
|
||||
@@ -258,7 +261,7 @@ index edb0482f0bfb22c70a585b0770e5b0437983779e..545f65db4fe8b807b388d5552842cd9e
|
||||
if (this._searchModeIndicatorTitle) {
|
||||
this._searchModeIndicatorTitle.textContent = "";
|
||||
this._searchModeIndicatorTitle.removeAttribute("data-l10n-id");
|
||||
@@ -4549,6 +4648,7 @@ export class UrlbarInput extends HTMLElement {
|
||||
@@ -4549,6 +4651,7 @@ export class UrlbarInput extends HTMLElement {
|
||||
|
||||
this.document.l10n.setAttributes(
|
||||
this.inputField,
|
||||
@@ -266,7 +269,7 @@ index edb0482f0bfb22c70a585b0770e5b0437983779e..545f65db4fe8b807b388d5552842cd9e
|
||||
l10nId,
|
||||
l10nId == "urlbar-placeholder-with-name"
|
||||
? { name: engineName }
|
||||
@@ -4662,6 +4762,11 @@ export class UrlbarInput extends HTMLElement {
|
||||
@@ -4662,6 +4765,11 @@ export class UrlbarInput extends HTMLElement {
|
||||
}
|
||||
|
||||
_on_click(event) {
|
||||
@@ -278,7 +281,7 @@ index edb0482f0bfb22c70a585b0770e5b0437983779e..545f65db4fe8b807b388d5552842cd9e
|
||||
switch (event.target) {
|
||||
case this.inputField:
|
||||
case this._inputContainer:
|
||||
@@ -4740,7 +4845,7 @@ export class UrlbarInput extends HTMLElement {
|
||||
@@ -4740,7 +4848,7 @@ export class UrlbarInput extends HTMLElement {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,7 +290,7 @@ index edb0482f0bfb22c70a585b0770e5b0437983779e..545f65db4fe8b807b388d5552842cd9e
|
||||
this.view.autoOpen({ event });
|
||||
} else {
|
||||
if (this._untrimOnFocusAfterKeydown) {
|
||||
@@ -4780,9 +4885,16 @@ export class UrlbarInput extends HTMLElement {
|
||||
@@ -4780,9 +4888,16 @@ export class UrlbarInput extends HTMLElement {
|
||||
}
|
||||
|
||||
_on_mousedown(event) {
|
||||
@@ -305,7 +308,7 @@ index edb0482f0bfb22c70a585b0770e5b0437983779e..545f65db4fe8b807b388d5552842cd9e
|
||||
if (
|
||||
event.composedTarget != this.inputField &&
|
||||
event.composedTarget != this._inputContainer
|
||||
@@ -4792,6 +4904,10 @@ export class UrlbarInput extends HTMLElement {
|
||||
@@ -4792,6 +4907,10 @@ export class UrlbarInput extends HTMLElement {
|
||||
|
||||
this.focusedViaMousedown = !this.focused;
|
||||
this._preventClickSelectsAll = this.focused;
|
||||
@@ -316,7 +319,7 @@ index edb0482f0bfb22c70a585b0770e5b0437983779e..545f65db4fe8b807b388d5552842cd9e
|
||||
|
||||
// Keep the focus status, since the attribute may be changed
|
||||
// upon calling this.focus().
|
||||
@@ -4827,7 +4943,7 @@ export class UrlbarInput extends HTMLElement {
|
||||
@@ -4827,7 +4946,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.
|
||||
@@ -325,7 +328,7 @@ index edb0482f0bfb22c70a585b0770e5b0437983779e..545f65db4fe8b807b388d5552842cd9e
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -5155,7 +5271,7 @@ export class UrlbarInput extends HTMLElement {
|
||||
@@ -5155,7 +5274,7 @@ export class UrlbarInput extends HTMLElement {
|
||||
// When we are in actions search mode we can show more results so
|
||||
// increase the limit.
|
||||
let maxResults =
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
diff --git a/browser/extensions/newtab/lib/ActivityStream.sys.mjs b/browser/extensions/newtab/lib/ActivityStream.sys.mjs
|
||||
index ae3c01650b3023a692cd4c50e33e3c3c39770c47..27a5fb0a630b9b79566be08cd5f7c9466ca30381 100644
|
||||
index 0f73c33c3237413131a2f4d2d1f3be857e533437..d7e9fcadc7744651fbe14952589df4603e7db592 100644
|
||||
--- a/browser/extensions/newtab/lib/ActivityStream.sys.mjs
|
||||
+++ b/browser/extensions/newtab/lib/ActivityStream.sys.mjs
|
||||
@@ -295,7 +295,7 @@ export const PREFS_CONFIG = new Map([
|
||||
|
||||
@@ -485,7 +485,7 @@
|
||||
}
|
||||
|
||||
#zen-site-data-icon-button {
|
||||
padding: 0 6px !important;
|
||||
padding: 0 4px !important;
|
||||
border-radius: var(--urlbar-icon-border-radius) !important;
|
||||
|
||||
& image {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
diff --git a/layout/generic/nsIFrame.cpp b/layout/generic/nsIFrame.cpp
|
||||
index c0ca05afc1e8eb5cb7115a22c39dcf45285fdfb7..84b3fec2c7b2bc671e7004d8571dc428b8ee011d 100644
|
||||
index 2c4aca4a5984fc3201a2c643f8d26b8c4f4ef3bd..4c21cee90e5442d45cdb2bcf3f91200f0441218f 100644
|
||||
--- a/layout/generic/nsIFrame.cpp
|
||||
+++ b/layout/generic/nsIFrame.cpp
|
||||
@@ -11958,6 +11958,11 @@ gfx::Matrix nsIFrame::ComputeWidgetTransform() const {
|
||||
@@ -11956,6 +11956,11 @@ gfx::Matrix nsIFrame::ComputeWidgetTransform() const {
|
||||
gfx::Matrix4x4 matrix = nsStyleTransformMatrix::ReadTransforms(
|
||||
uiReset->mMozWindowTransform, refBox, float(appUnitsPerDevPixel));
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp
|
||||
index 3c84ea049b01c20c6a7e9ff717e19d1d9e86248b..ed6b15dffa571348d1c13bf31f3b2e1638151e8f 100644
|
||||
index 25357c6a506b969c5049190c29e4e411ee5f4c31..bef909ddfc28d084cf87cae3fbd050bbde21468d 100644
|
||||
--- a/layout/style/nsStyleStruct.cpp
|
||||
+++ b/layout/style/nsStyleStruct.cpp
|
||||
@@ -3217,6 +3217,9 @@ nsStyleUIReset::nsStyleUIReset()
|
||||
@@ -3270,6 +3270,9 @@ nsStyleUIReset::nsStyleUIReset()
|
||||
mWindowShadow(StyleWindowShadow::Auto),
|
||||
mWindowOpacity(1.0),
|
||||
mMozWindowInputRegionMargin(StyleLength::Zero()),
|
||||
@@ -12,7 +12,7 @@ index 3c84ea049b01c20c6a7e9ff717e19d1d9e86248b..ed6b15dffa571348d1c13bf31f3b2e16
|
||||
mTransitions(
|
||||
nsStyleAutoArray<StyleTransition>::WITH_SINGLE_INITIAL_ELEMENT),
|
||||
mTransitionTimingFunctionCount(1),
|
||||
@@ -3261,6 +3264,7 @@ nsStyleUIReset::nsStyleUIReset(const nsStyleUIReset& aSource)
|
||||
@@ -3314,6 +3317,7 @@ nsStyleUIReset::nsStyleUIReset(const nsStyleUIReset& aSource)
|
||||
mWindowOpacity(aSource.mWindowOpacity),
|
||||
mMozWindowInputRegionMargin(aSource.mMozWindowInputRegionMargin),
|
||||
mMozWindowTransform(aSource.mMozWindowTransform),
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h
|
||||
index 20d0dc30020ee7fcd27f689cb6c0754224b003c5..dcca0efd2c9822937c994dffeb63d2263fbb6331 100644
|
||||
index ca11ab168761a6da23811d802a87f6c31af6cca9..cb74679626620a12d37fb1671c373ea9793ae004 100644
|
||||
--- a/layout/style/nsStyleStruct.h
|
||||
+++ b/layout/style/nsStyleStruct.h
|
||||
@@ -2080,6 +2080,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleUIReset {
|
||||
@@ -2094,6 +2094,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleUIReset {
|
||||
// The margin of the window region that should be transparent to events.
|
||||
mozilla::StyleLength mMozWindowInputRegionMargin;
|
||||
mozilla::StyleTransform mMozWindowTransform;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml
|
||||
index cc7fd419035a972bfab1b0e7631b8856e846ce81..b4e6d699f99e7164e62ce20792919420a8e73810 100644
|
||||
index 0986e53121fdb821bca4a7c30ff707bfdf2dbad7..2a1865098a00282aa1839df245cb472cdd64fdec 100644
|
||||
--- a/modules/libpref/init/StaticPrefList.yaml
|
||||
+++ b/modules/libpref/init/StaticPrefList.yaml
|
||||
@@ -19738,6 +19738,7 @@
|
||||
@@ -19748,6 +19748,7 @@
|
||||
mirror: always
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
diff --git a/toolkit/content/widgets/arrowscrollbox.js b/toolkit/content/widgets/arrowscrollbox.js
|
||||
index b80d1049bb6ae305f2ac9c4c35fe975fd508031c..0d900883d903ed48ac57863c0468ab39a6f3d98f 100644
|
||||
index b80d1049bb6ae305f2ac9c4c35fe975fd508031c..9bc80194d4e35f663b5c15baae55fa48eed4ffe9 100644
|
||||
--- a/toolkit/content/widgets/arrowscrollbox.js
|
||||
+++ b/toolkit/content/widgets/arrowscrollbox.js
|
||||
@@ -98,6 +98,7 @@
|
||||
@@ -15,7 +15,7 @@ index b80d1049bb6ae305f2ac9c4c35fe975fd508031c..0d900883d903ed48ac57863c0468ab39
|
||||
on_wheel(event) {
|
||||
// Don't consume the event if we can't scroll.
|
||||
- if (!this.overflowing) {
|
||||
+ if (!this.overflowing || this.id === 'tabbrowser-arrowscrollbox' || ((event.deltaY == 0 || gZenWorkspaces._swipeState?.isGestureActive) && this.classList.contains('workspace-arrowscrollbox'))) {
|
||||
+ if (!this.overflowing || this.id === 'tabbrowser-arrowscrollbox' || ((event.deltaY == 0 || window.gZenWorkspaces?._swipeState?.isGestureActive) && this.classList.contains('workspace-arrowscrollbox'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
diff --git a/toolkit/modules/AppConstants.sys.mjs b/toolkit/modules/AppConstants.sys.mjs
|
||||
index 5465ed3fb01e4214029b44f338d5e1e1580c3aab..a4d6b42916014d5e0f643b35a7b4feb281f59023 100644
|
||||
index e2a22ddd6c6ba36491f37ed22bc2e1fbc149790c..920d8649ef48d685891223a834110ad9a059001a 100644
|
||||
--- a/toolkit/modules/AppConstants.sys.mjs
|
||||
+++ b/toolkit/modules/AppConstants.sys.mjs
|
||||
@@ -172,6 +172,8 @@ export var AppConstants = Object.freeze({
|
||||
@@ -170,6 +170,8 @@ export var AppConstants = Object.freeze({
|
||||
MOZ_UPDATE_CHANNEL: "@MOZ_UPDATE_CHANNEL@",
|
||||
MOZ_WIDGET_TOOLKIT: "@MOZ_WIDGET_TOOLKIT@",
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
diff --git a/toolkit/modules/moz.build b/toolkit/modules/moz.build
|
||||
index abc630955c18de629d3ffff3e8f9aa29f57950be..97d6d5f25d0859684c405c659e0eef26007027c4 100644
|
||||
index 114a8c3e2e36e57cb2334a893a11f1619831a6e7..9c9ae37b6462d00c93d8f3319cea2960b3cd9816 100644
|
||||
--- a/toolkit/modules/moz.build
|
||||
+++ b/toolkit/modules/moz.build
|
||||
@@ -281,6 +281,7 @@ for var in (
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
diff --git a/toolkit/themes/shared/popup.css b/toolkit/themes/shared/popup.css
|
||||
index c2618b86d7e8bb71f9f7f71ef9916c8140ca1ead..9e2006015e22f1ac043c46066c4c9a85fe053a21 100644
|
||||
index c2618b86d7e8bb71f9f7f71ef9916c8140ca1ead..96a602f9cbfb77ee0a52151ce8ccf7ba17cf5c43 100644
|
||||
--- a/toolkit/themes/shared/popup.css
|
||||
+++ b/toolkit/themes/shared/popup.css
|
||||
@@ -22,8 +22,8 @@ panel {
|
||||
@@ -13,3 +13,24 @@ index c2618b86d7e8bb71f9f7f71ef9916c8140ca1ead..9e2006015e22f1ac043c46066c4c9a85
|
||||
-moz-window-input-region-margin: var(--panel-shadow-margin);
|
||||
margin: calc(-1 * var(--panel-shadow-margin));
|
||||
|
||||
@@ -143,11 +143,7 @@ panel[type="arrow"] {
|
||||
-moz-window-transform,
|
||||
-moz-window-opacity;
|
||||
@media not (prefers-reduced-motion) {
|
||||
- -moz-window-transform: translateY(-70px);
|
||||
-
|
||||
- &:where([side="bottom"]) {
|
||||
- -moz-window-transform: translateY(70px);
|
||||
- }
|
||||
+ -moz-window-transform: scale(0);
|
||||
}
|
||||
/* Only do the fade-in animation on pre-Big Sur to avoid missing shadows on
|
||||
* Big Sur+, see bug 1672091. */
|
||||
@@ -161,7 +157,6 @@ panel[type="arrow"] {
|
||||
}
|
||||
|
||||
&[animate="cancel"] {
|
||||
- -moz-window-transform: none;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp
|
||||
index 64456439499d449ce7f2861b1a5addbeecd61721..d0acdb3082b4805e2b8903f8044c97ddf29419bb 100644
|
||||
index 5eae0bca990fea9e995bd2edf5e879361f89391c..3f8bfedb83ddae07b1e82715fc7f6b2109a39e33 100644
|
||||
--- a/toolkit/xre/nsXREDirProvider.cpp
|
||||
+++ b/toolkit/xre/nsXREDirProvider.cpp
|
||||
@@ -1317,9 +1317,11 @@ nsresult nsXREDirProvider::AppendFromAppData(nsIFile* aFile, bool aIsDotted) {
|
||||
@@ -1322,9 +1322,11 @@ nsresult nsXREDirProvider::AppendFromAppData(nsIFile* aFile, bool aIsDotted) {
|
||||
// Similar to nsXREDirProvider::AppendProfilePath.
|
||||
// TODO: Bug 1990407 - Evaluate if refactoring might be required there in the
|
||||
// future?
|
||||
@@ -15,7 +15,7 @@ index 64456439499d449ce7f2861b1a5addbeecd61721..d0acdb3082b4805e2b8903f8044c97dd
|
||||
MOZ_TRY(aFile->AppendRelativeNativePath(profile));
|
||||
} else {
|
||||
nsAutoCString vendor;
|
||||
@@ -1329,8 +1331,6 @@ nsresult nsXREDirProvider::AppendFromAppData(nsIFile* aFile, bool aIsDotted) {
|
||||
@@ -1334,8 +1336,6 @@ nsresult nsXREDirProvider::AppendFromAppData(nsIFile* aFile, bool aIsDotted) {
|
||||
ToLowerCase(vendor);
|
||||
ToLowerCase(appName);
|
||||
|
||||
@@ -24,7 +24,7 @@ index 64456439499d449ce7f2861b1a5addbeecd61721..d0acdb3082b4805e2b8903f8044c97dd
|
||||
MOZ_TRY(aFile->AppendRelativeNativePath(appName));
|
||||
}
|
||||
|
||||
@@ -1498,13 +1498,8 @@ nsresult nsXREDirProvider::GetLegacyOrXDGHomePath(const char* aHomeDir,
|
||||
@@ -1503,13 +1503,8 @@ nsresult nsXREDirProvider::GetLegacyOrXDGHomePath(const char* aHomeDir,
|
||||
|
||||
// If the build was made against a specific profile name, MOZ_APP_PROFILE=
|
||||
// then make sure we respect this and dont move to XDG directory
|
||||
|
||||
@@ -222,7 +222,7 @@ window.gZenUIManager = {
|
||||
"--zen-urlbar-top",
|
||||
`${window.innerHeight / 2 - Math.max(kUrlbarHeight, gURLBar.getBoundingClientRect().height) / 2}px`
|
||||
);
|
||||
gURLBar.style.setProperty("--zen-urlbar-width", `${Math.min(window.innerWidth / 2, 700)}px`);
|
||||
gURLBar.style.setProperty("--zen-urlbar-width", `${Math.min(window.innerWidth / 2, 750)}px`);
|
||||
gZenVerticalTabsManager.actualWindowButtons.removeAttribute("zen-has-hover");
|
||||
gZenVerticalTabsManager.recalculateURLBarHeight();
|
||||
if (!this._preventToolbarRebuild) {
|
||||
@@ -570,11 +570,10 @@ window.gZenUIManager = {
|
||||
},
|
||||
|
||||
urlbarTrim(aURL) {
|
||||
if (
|
||||
gZenVerticalTabsManager._hasSetSingleToolbar &&
|
||||
this.urlbarShowDomainOnly &&
|
||||
!gURLBar.hasAttribute("breakout-extend")
|
||||
) {
|
||||
if (gURLBar.hasAttribute("breakout-extend")) {
|
||||
return aURL;
|
||||
}
|
||||
if (gZenVerticalTabsManager._hasSetSingleToolbar && this.urlbarShowDomainOnly) {
|
||||
let url = BrowserUIUtils.removeSingleTrailingSlashFromURL(aURL);
|
||||
return url.startsWith("https://") ? url.split("/")[2] : url;
|
||||
}
|
||||
|
||||
@@ -4,18 +4,6 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
@keyframes zen-jello-animation-macos {
|
||||
0% {
|
||||
-moz-window-opacity: 0;
|
||||
-moz-window-transform: scale(0.8);
|
||||
}
|
||||
|
||||
100% {
|
||||
-moz-window-opacity: 1;
|
||||
-moz-window-transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes zen-theme-picker-dot-animation {
|
||||
from {
|
||||
transform: scale(0.8) translate(-50%, -50%);
|
||||
|
||||
@@ -132,7 +132,6 @@
|
||||
}
|
||||
|
||||
#nav-bar {
|
||||
overflow: clip;
|
||||
border-top-color: transparent !important;
|
||||
|
||||
:root[zen-single-toolbar="true"] & {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
}
|
||||
|
||||
.urlbar {
|
||||
--urlbarView-separator-color: light-dark(hsl(0, 0%, 89%), hsl(0, 0%, 20%));
|
||||
--urlbarView-separator-color: light-dark(hsl(0, 0%, 92%), hsl(0, 0%, 20%));
|
||||
--urlbarView-hover-background: var(--toolbarbutton-hover-background);
|
||||
--urlbarView-highlight-background: var(--toolbarbutton-hover-background);
|
||||
border-radius: calc(var(--toolbarbutton-border-radius) - 2px);
|
||||
@@ -209,7 +209,7 @@
|
||||
margin: 0;
|
||||
|
||||
:root[zen-single-toolbar="true"] & {
|
||||
padding: 6px !important;
|
||||
padding: 5px !important;
|
||||
width: unset !important;
|
||||
height: unset !important;
|
||||
}
|
||||
@@ -396,7 +396,7 @@
|
||||
#urlbar #tracking-protection-icon-container,
|
||||
#urlbar:not([breakout-extend="true"]) #identity-box:is(:not(.chromeUI), [pageproxystate="invalid"]) #identity-icon-box {
|
||||
border-radius: var(--urlbar-icon-border-radius) !important;
|
||||
min-width: 28px;
|
||||
min-width: 26px;
|
||||
}
|
||||
|
||||
/* Notification Stack */
|
||||
@@ -649,7 +649,7 @@
|
||||
}
|
||||
|
||||
&[selected] {
|
||||
--zen-selected-bg: color-mix(in srgb, var(--zen-primary-color) 50%, light-dark(rgba(0, 0, 0, 0.5), rgba(255, 255, 255, 0.2)) 50%);
|
||||
--zen-selected-bg: color-mix(in srgb, var(--zen-primary-color) 55%, light-dark(rgba(0, 0, 0, 0.5), rgba(255, 255, 255, 0.2)) 50%);
|
||||
--zen-selected-color: color-mix(in srgb, var(--zen-selected-bg), black 30%);
|
||||
background-color: var(--zen-selected-bg) !important;
|
||||
|
||||
@@ -667,7 +667,7 @@
|
||||
color: var(--zen-selected-color) !important;
|
||||
}
|
||||
|
||||
&:is([type="switchtab"], [type="dynamic"]) .urlbarView-favicon,
|
||||
&:is([type="switchtab"], [type="dynamic"], [type="history_serp"], [type="autofill_origin"], [type="top_site"]) .urlbarView-favicon,
|
||||
& .urlbarView-shortcutContent {
|
||||
fill: var(--zen-selected-color) !important;
|
||||
background-color: rgba(255, 255, 255, 0.9) !important;
|
||||
|
||||
@@ -9,18 +9,29 @@ panel[type="arrow"] {
|
||||
/* Animate from the bottom */
|
||||
-zen-window-transform-origin: 0 100%;
|
||||
}
|
||||
&[side="left"] {
|
||||
/* Animate from the left and center */
|
||||
-zen-window-transform-origin: 0 50%;
|
||||
}
|
||||
&[side="right"] {
|
||||
/* Animate from the right */
|
||||
-zen-window-transform-origin: 100% 50%;
|
||||
}
|
||||
:root[zen-right-side="true"] & {
|
||||
/* Animate from the right */
|
||||
-zen-window-transform-origin: 100% 0;
|
||||
|
||||
&[side="bottom"] {
|
||||
/* Animate from the bottom right */
|
||||
-zen-window-transform-origin: 100% 100%;
|
||||
}
|
||||
}
|
||||
-moz-window-opacity: 0;
|
||||
&[animate="open"] {
|
||||
animation: zen-jello-animation-macos 0.2s ease-in-out forwards !important;
|
||||
&[side="left"] {
|
||||
/* Animate from the right */
|
||||
-zen-window-transform-origin: 100% 50%;
|
||||
}
|
||||
&[side="right"] {
|
||||
/* Animate from the right */
|
||||
-zen-window-transform-origin: 100% 50%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,12 +172,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
.toolbarbutton-1:not(#tabs-newtab-button) {
|
||||
.toolbarbutton-1:not(#tabs-newtab-button),
|
||||
.urlbar-page-action,
|
||||
.identity-box-button {
|
||||
--tab-border-radius: 6px;
|
||||
--toolbarbutton-border-radius: var(--tab-border-radius);
|
||||
--toolbarbutton-inner-padding: 6px;
|
||||
--toolbarbutton-outer-padding: 2px;
|
||||
color: color-mix(in srgb, currentColor 60%, transparent);
|
||||
--toolbarbutton-outer-padding: 1px;
|
||||
--toolbarbutton-icon-fill: color-mix(in srgb, currentColor 70%, transparent);
|
||||
|
||||
transition:
|
||||
background-color 0.1s,
|
||||
@@ -192,10 +194,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
#zen-sidebar-top-buttons toolbarbutton {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.zen-interactive-button {
|
||||
background: color-mix(in srgb, currentColor 6%, transparent) !important;
|
||||
transition:
|
||||
@@ -386,6 +384,7 @@
|
||||
&:hover {
|
||||
background-color: color-mix(in srgb, currentColor 10%, transparent);
|
||||
}
|
||||
|
||||
.zen-site-data-section:hover & {
|
||||
opacity: 0.5;
|
||||
}
|
||||
@@ -541,7 +540,7 @@
|
||||
0px 2px 4px rgba(0, 0, 0, 0.1),
|
||||
inset 0px 1px 0px light-dark(transparent, rgba(255, 255, 255, 0.15));
|
||||
border-radius: 6px;
|
||||
--base-border-color: light-dark(rgba(0, 0, 0, 0.175), rgba(255, 255, 255, 0.1));
|
||||
--base-border-color: light-dark(rgba(0, 0, 0, 0.3), rgba(255, 255, 255, 0.1));
|
||||
border: 1px solid light-dark(var(--base-border-color), rgb(21, 21, 21));
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
:host(:is(.anonymous-content-host, notification-message)),
|
||||
:root:not([windowtype^="Browser:"]) {
|
||||
:root {
|
||||
/* Default values */
|
||||
--zen-border-radius: 7px;
|
||||
--zen-primary-color: AccentColor;
|
||||
@@ -145,7 +145,7 @@
|
||||
color-mix(in oklch, var(--toolbox-textcolor) 15%, transparent)
|
||||
);
|
||||
|
||||
--zen-toolbar-element-bg-hover: light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.2));
|
||||
--zen-toolbar-element-bg-hover: light-dark(rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.1));
|
||||
|
||||
/* Toolbar */
|
||||
--tab-selected-color-scheme: inherit !important;
|
||||
@@ -288,7 +288,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
#main-window:not([chromehidden~='toolbar']) {
|
||||
#main-window[windowtype="navigator:browser"]:not([chromehidden~='toolbar']) {
|
||||
min-height: 495px !important;
|
||||
|
||||
@media (-moz-windows-mica) or (-moz-platform: macos) or ((-moz-platform: linux) and
|
||||
|
||||
@@ -12,12 +12,12 @@ document.addEventListener(
|
||||
case "cmd_zenCompactModeToggle":
|
||||
gZenCompactModeManager.toggle();
|
||||
break;
|
||||
case "cmd_zenCompactModeShowSidebar":
|
||||
gZenCompactModeManager.toggleSidebar();
|
||||
break;
|
||||
case "cmd_toggleCompactModeIgnoreHover":
|
||||
gZenCompactModeManager.toggle(true);
|
||||
break;
|
||||
case "cmd_zenCompactModeShowSidebar":
|
||||
gZenCompactModeManager.toggleSidebar();
|
||||
break;
|
||||
case "cmd_zenWorkspaceForward":
|
||||
gZenWorkspaces.changeWorkspaceShortcut();
|
||||
break;
|
||||
|
||||
@@ -630,6 +630,7 @@ window.gZenCompactModeManager = {
|
||||
_setElementExpandAttribute(element, value, attr = "zen-has-hover") {
|
||||
const kVerifiedAttributes = ["zen-has-hover", "has-popup-menu", "zen-compact-mode-active"];
|
||||
const isToolbar = element.id === "zen-appcontent-navbar-wrapper";
|
||||
this.log("Setting", attr, "to", value, "on element", element?.id);
|
||||
if (value) {
|
||||
if (attr === "zen-has-hover" && element !== gZenVerticalTabsManager.actualWindowButtons) {
|
||||
element.setAttribute("zen-has-implicit-hover", "true");
|
||||
@@ -666,6 +667,7 @@ window.gZenCompactModeManager = {
|
||||
|
||||
addMouseActions() {
|
||||
gURLBar.addEventListener("mouseenter", (event) => {
|
||||
this.log("Mouse entered URL bar:", event.target);
|
||||
if (event.target.closest("#urlbar[zen-floating-urlbar]")) {
|
||||
window.requestAnimationFrame(() => {
|
||||
this._setElementExpandAttribute(gZenVerticalTabsManager.actualWindowButtons, false);
|
||||
|
||||
@@ -105,6 +105,7 @@
|
||||
|
||||
startTabDrag(event, tab, ...args) {
|
||||
this.ZenDragAndDropService.onDragStart(1);
|
||||
this.#isOutOfWindow = false;
|
||||
gZenCompactModeManager._isTabBeingDragged = true;
|
||||
super.startTabDrag(event, tab, ...args);
|
||||
const dt = event.dataTransfer;
|
||||
@@ -861,6 +862,7 @@
|
||||
const draggedTab = dt.mozGetDataAt(TAB_DROP_TYPE, 0);
|
||||
let ownerGlobal = draggedTab?.ownerGlobal;
|
||||
draggedTab.style.visibility = "";
|
||||
let thisFromGlobal = ownerGlobal?.gBrowser.tabContainer.tabDragAndDrop;
|
||||
let currentEssenialContainer = ownerGlobal.gZenWorkspaces.getCurrentEssentialsContainer();
|
||||
if (currentEssenialContainer?.essentialsPromo) {
|
||||
currentEssenialContainer.essentialsPromo.remove();
|
||||
@@ -870,19 +872,21 @@
|
||||
ownerGlobal.gZenFolders.highlightGroupOnDragOver(null);
|
||||
this.ZenDragAndDropService.onDragEnd();
|
||||
super.handle_dragend(event);
|
||||
this.#removeDragOverBackground();
|
||||
thisFromGlobal.clearDragOverVisuals();
|
||||
ownerGlobal.gZenPinnedTabManager.removeTabContainersDragoverClass();
|
||||
this.#maybeClearVerticalPinnedGridDragOver();
|
||||
this.originalDragImageArgs = [];
|
||||
window.removeEventListener("dragenter", this.handle_windowDragEnter, { capture: true });
|
||||
thisFromGlobal.originalDragImageArgs = [];
|
||||
window.removeEventListener("dragenter", thisFromGlobal.handle_windowDragEnter, {
|
||||
capture: true,
|
||||
});
|
||||
this.#isOutOfWindow = false;
|
||||
if (this._browserDragImageWrapper) {
|
||||
this._browserDragImageWrapper.remove();
|
||||
delete this._browserDragImageWrapper;
|
||||
if (thisFromGlobal._browserDragImageWrapper) {
|
||||
thisFromGlobal._browserDragImageWrapper.remove();
|
||||
delete thisFromGlobal._browserDragImageWrapper;
|
||||
}
|
||||
if (this._tempDragImageParent) {
|
||||
this._tempDragImageParent.remove();
|
||||
delete this._tempDragImageParent;
|
||||
if (thisFromGlobal._tempDragImageParent) {
|
||||
thisFromGlobal._tempDragImageParent.remove();
|
||||
delete thisFromGlobal._tempDragImageParent;
|
||||
}
|
||||
delete ownerGlobal.gZenCompactModeManager._isTabBeingDragged;
|
||||
if (dt.dropEffect !== "move") {
|
||||
@@ -941,14 +945,19 @@
|
||||
);
|
||||
if (event.target.classList.contains("zen-workspace-empty-space") || hoveringPeriphery) {
|
||||
let lastTab = gBrowser.tabs.at(-1);
|
||||
dropElement =
|
||||
(hoveringPeriphery && Services.prefs.getBoolPref("zen.view.show-newtab-button-top")
|
||||
? this._tabbrowserTabs.ariaFocusableItems.at(
|
||||
gBrowser._numVisiblePinTabsWithoutCollapsed
|
||||
)
|
||||
: this._tabbrowserTabs.ariaFocusableItems.at(-1)) || lastTab;
|
||||
let pinnedTabsCount = gBrowser._numVisiblePinTabsWithoutCollapsed;
|
||||
|
||||
// Only if there are no normal tabs to drop after
|
||||
showIndicatorUnderNewTabButton = lastTab.hasAttribute("zen-empty-tab");
|
||||
let useLastPinnd =
|
||||
(hoveringPeriphery ||
|
||||
(showIndicatorUnderNewTabButton &&
|
||||
!(pinnedTabsCount - gBrowser._numZenEssentials))) &&
|
||||
Services.prefs.getBoolPref("zen.view.show-newtab-button-top");
|
||||
dropElement =
|
||||
(useLastPinnd
|
||||
? this._tabbrowserTabs.ariaFocusableItems.at(pinnedTabsCount)
|
||||
: this._tabbrowserTabs.ariaFocusableItems.at(-1)) || lastTab;
|
||||
}
|
||||
}
|
||||
dropElement = elementToMove(dropElement);
|
||||
|
||||
@@ -256,6 +256,7 @@ export class nsZenFolder extends MozTabbrowserTabGroup {
|
||||
folderToUnload: this,
|
||||
});
|
||||
this.activeTabs = [];
|
||||
this.collapsed = true;
|
||||
}
|
||||
|
||||
on_click(event) {
|
||||
|
||||
@@ -179,7 +179,7 @@ class nsZenFolders extends nsZenDOMOperatedFeature {
|
||||
if (this.#popup.matches(":hover")) {
|
||||
return;
|
||||
}
|
||||
this.#popup.hidePopup();
|
||||
this.#popup.hidePopup(true);
|
||||
}, 200);
|
||||
});
|
||||
}
|
||||
@@ -357,7 +357,7 @@ class nsZenFolders extends nsZenDOMOperatedFeature {
|
||||
this.#mouseTimer = null;
|
||||
}
|
||||
if (this.#popup) {
|
||||
this.#popup.hidePopup();
|
||||
this.#popup.hidePopup(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -729,11 +729,13 @@ class nsZenFolders extends nsZenDOMOperatedFeature {
|
||||
|
||||
get #searchPopupOptions() {
|
||||
const isRightSide = gZenVerticalTabsManager._prefsRightSide;
|
||||
const position = isRightSide ? "topleft topright" : "topright topleft";
|
||||
const position = isRightSide ? "start_before" : "start_before";
|
||||
let size = Math.min(this.#popup.querySelector("#zen-folder-tabs-list").children.length, 6);
|
||||
size *= 48;
|
||||
return {
|
||||
position,
|
||||
x: 10,
|
||||
y: -25,
|
||||
x: -10,
|
||||
y: size / -2,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -958,7 +960,7 @@ class nsZenFolders extends nsZenDOMOperatedFeature {
|
||||
if (this.#popup.matches(":hover")) {
|
||||
return;
|
||||
}
|
||||
this.#popup.hidePopup();
|
||||
this.#popup.hidePopup(true);
|
||||
}, 200);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -98,6 +98,7 @@ zen-folder {
|
||||
|
||||
& svg {
|
||||
filter: contrast(125%);
|
||||
transform: translate(-1px, -1px);
|
||||
|
||||
:root:not([zen-sidebar-expanded]) & {
|
||||
transition: transform 0.1s ease;
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
box-shadow: 0 0 12px 1px rgba(0, 0, 0, 0.07);
|
||||
padding: 8px;
|
||||
opacity: 1 !important;
|
||||
color: var(--zen-primary-color);
|
||||
color: var(--zen-primary-color) !important;
|
||||
|
||||
&:hover {
|
||||
background: light-dark(rgb(41, 41, 41), rgb(204, 204, 204));
|
||||
|
||||
@@ -677,7 +677,7 @@ class nsZenKeyboardShortcutsLoader {
|
||||
"",
|
||||
ZEN_COMPACT_MODE_SHORTCUTS_GROUP,
|
||||
nsKeyShortcutModifiers.fromObject({ accel: true }),
|
||||
"cmd_zenCompactModeToggle",
|
||||
"cmd_toggleCompactModeIgnoreHover",
|
||||
"zen-compact-mode-shortcut-toggle"
|
||||
)
|
||||
);
|
||||
@@ -812,7 +812,7 @@ class nsZenKeyboardShortcutsLoader {
|
||||
}
|
||||
|
||||
class nsZenKeyboardShortcutsVersioner {
|
||||
static LATEST_KBS_VERSION = 14;
|
||||
static LATEST_KBS_VERSION = 16;
|
||||
|
||||
constructor() {}
|
||||
|
||||
@@ -1146,6 +1146,17 @@ class nsZenKeyboardShortcutsVersioner {
|
||||
}
|
||||
}
|
||||
|
||||
if (version < 16) {
|
||||
// Migrate from version 14 to 16.
|
||||
// We move the action for "toggle compact mode" to "cmd_toggleCompactModeIgnoreHover"
|
||||
for (let shortcut of data) {
|
||||
if (shortcut.getID() == "zen-compact-mode-toggle") {
|
||||
shortcut._setAction("cmd_toggleCompactModeIgnoreHover");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,14 +80,14 @@ export class nsZenSessionManager {
|
||||
|
||||
init() {
|
||||
this.log("Initializing session manager");
|
||||
let backupFile = null;
|
||||
let backupTo = null;
|
||||
if (SHOULD_BACKUP_FILE) {
|
||||
backupFile = PathUtils.join(this.#backupFolderPath, FILE_NAME);
|
||||
backupTo = PathUtils.join(this.#backupFolderPath, "recovery.baklz4");
|
||||
}
|
||||
this.#file = new JSONFile({
|
||||
path: this.#storeFilePath,
|
||||
compression: "lz4",
|
||||
backupFile,
|
||||
backupTo,
|
||||
});
|
||||
this.log("Session file path:", this.#file.path);
|
||||
this.#deferredBackupTask = new lazy.DeferredTask(async () => {
|
||||
@@ -98,18 +98,16 @@ export class nsZenSessionManager {
|
||||
log(...args) {
|
||||
if (lazy.gShouldLog) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("ZenSessionManager:", ...args);
|
||||
console.debug("ZenSessionManager:", ...args);
|
||||
}
|
||||
}
|
||||
|
||||
get #storeFilePath() {
|
||||
let profileDir = Services.dirsvc.get("ProfD", Ci.nsIFile).path;
|
||||
return PathUtils.join(profileDir, FILE_NAME);
|
||||
return PathUtils.join(PathUtils.profileDir, FILE_NAME);
|
||||
}
|
||||
|
||||
get #backupFolderPath() {
|
||||
let profileDir = Services.dirsvc.get("ProfD", Ci.nsIFile).path;
|
||||
return PathUtils.join(profileDir, "zen-sessions-backup");
|
||||
return PathUtils.join(PathUtils.profileDir, "zen-sessions-backup");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,37 +123,47 @@ export class nsZenSessionManager {
|
||||
const db = await PlacesUtils.promiseDBConnection();
|
||||
let data = {};
|
||||
let rows = await db.execute("SELECT * FROM zen_workspaces ORDER BY created_at ASC");
|
||||
data.spaces = rows.map((row) => ({
|
||||
uuid: row.getResultByName("uuid"),
|
||||
name: row.getResultByName("name"),
|
||||
icon: row.getResultByName("icon"),
|
||||
containerTabId: row.getResultByName("container_id") ?? 0,
|
||||
position: row.getResultByName("position"),
|
||||
theme: row.getResultByName("theme_type")
|
||||
? {
|
||||
type: row.getResultByName("theme_type"),
|
||||
gradientColors: JSON.parse(row.getResultByName("theme_colors")),
|
||||
opacity: row.getResultByName("theme_opacity"),
|
||||
rotation: row.getResultByName("theme_rotation"),
|
||||
texture: row.getResultByName("theme_texture"),
|
||||
}
|
||||
: null,
|
||||
}));
|
||||
rows = await db.execute("SELECT * FROM zen_pins ORDER BY position ASC");
|
||||
data.pins = rows.map((row) => ({
|
||||
uuid: row.getResultByName("uuid"),
|
||||
title: row.getResultByName("title"),
|
||||
url: row.getResultByName("url"),
|
||||
containerTabId: row.getResultByName("container_id"),
|
||||
workspaceUuid: row.getResultByName("workspace_uuid"),
|
||||
position: row.getResultByName("position"),
|
||||
isEssential: Boolean(row.getResultByName("is_essential")),
|
||||
isGroup: Boolean(row.getResultByName("is_group")),
|
||||
parentUuid: row.getResultByName("folder_parent_uuid"),
|
||||
editedTitle: Boolean(row.getResultByName("edited_title")),
|
||||
folderIcon: row.getResultByName("folder_icon"),
|
||||
isFolderCollapsed: Boolean(row.getResultByName("is_folder_collapsed")),
|
||||
}));
|
||||
try {
|
||||
data.spaces = rows.map((row) => ({
|
||||
uuid: row.getResultByName("uuid"),
|
||||
name: row.getResultByName("name"),
|
||||
icon: row.getResultByName("icon"),
|
||||
containerTabId: row.getResultByName("container_id") ?? 0,
|
||||
position: row.getResultByName("position"),
|
||||
theme: row.getResultByName("theme_type")
|
||||
? {
|
||||
type: row.getResultByName("theme_type"),
|
||||
gradientColors: JSON.parse(row.getResultByName("theme_colors")),
|
||||
opacity: row.getResultByName("theme_opacity"),
|
||||
rotation: row.getResultByName("theme_rotation"),
|
||||
texture: row.getResultByName("theme_texture"),
|
||||
}
|
||||
: null,
|
||||
}));
|
||||
} catch (e) {
|
||||
/* ignore errors reading spaces data, as it is not critical and we want to migrate even if we fail to read it */
|
||||
console.error("Failed to read spaces data from database during migration", e);
|
||||
}
|
||||
try {
|
||||
rows = await db.execute("SELECT * FROM zen_pins ORDER BY position ASC");
|
||||
data.pins = rows.map((row) => ({
|
||||
uuid: row.getResultByName("uuid"),
|
||||
title: row.getResultByName("title"),
|
||||
url: row.getResultByName("url"),
|
||||
containerTabId: row.getResultByName("container_id"),
|
||||
workspaceUuid: row.getResultByName("workspace_uuid"),
|
||||
position: row.getResultByName("position"),
|
||||
isEssential: Boolean(row.getResultByName("is_essential")),
|
||||
isGroup: Boolean(row.getResultByName("is_group")),
|
||||
parentUuid: row.getResultByName("folder_parent_uuid"),
|
||||
editedTitle: Boolean(row.getResultByName("edited_title")),
|
||||
folderIcon: row.getResultByName("folder_icon"),
|
||||
isFolderCollapsed: Boolean(row.getResultByName("is_folder_collapsed")),
|
||||
}));
|
||||
} catch (e) {
|
||||
/* ignore errors reading pins data, as it is not critical and we want to migrate even if we fail to read it */
|
||||
console.error("Failed to read pins data from database during migration", e);
|
||||
}
|
||||
try {
|
||||
data.recoveryData = await IOUtils.readJSON(
|
||||
PathUtils.join(
|
||||
@@ -185,8 +193,9 @@ export class nsZenSessionManager {
|
||||
}
|
||||
}
|
||||
this._migrationData = data;
|
||||
} catch {
|
||||
} catch (e) {
|
||||
/* ignore errors during migration */
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,6 +232,11 @@ export class nsZenSessionManager {
|
||||
this._shouldRunMigration = true;
|
||||
await this.#getDataFromDBForMigration();
|
||||
}
|
||||
if (Services.prefs.getBoolPref("zen.session-store.log-tab-entries", false)) {
|
||||
for (const tab of this.#sidebar.tabs || []) {
|
||||
this.log("Tab entry in session file:", tab);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
get #shouldRestoreOnlyPinned() {
|
||||
@@ -264,19 +278,33 @@ export class nsZenSessionManager {
|
||||
}
|
||||
return initialState;
|
||||
}
|
||||
const allowRestoreUnsynced = Services.prefs.getBoolPref(
|
||||
"zen.session-store.restore-unsynced-windows",
|
||||
true
|
||||
);
|
||||
if (initialState?.windows?.length && !allowRestoreUnsynced) {
|
||||
initialState.windows = initialState.windows.filter((win) => {
|
||||
if (win.isZenUnsynced) {
|
||||
this.log("Skipping unsynced window during restore");
|
||||
}
|
||||
return !win.isZenUnsynced;
|
||||
});
|
||||
}
|
||||
// If there are no windows, we create an empty one. By default,
|
||||
// firefox would create simply a new empty window, but we want
|
||||
// to make sure that the sidebar object is properly initialized.
|
||||
// This would happen on first run after having a single private window
|
||||
// open when quitting the app, for example.
|
||||
if (!initialState?.windows?.length) {
|
||||
let normalWindowsExist = initialState?.windows?.some(
|
||||
(win) => !win.isPrivate && !win.isPopup && !win.isTaskbarTab && !win.isZenUnsynced
|
||||
);
|
||||
if (!initialState?.windows?.length || !normalWindowsExist) {
|
||||
this.log("No windows found in initial state, creating an empty one");
|
||||
initialState ||= {};
|
||||
initialState.windows = [
|
||||
{
|
||||
tabs: [],
|
||||
},
|
||||
];
|
||||
initialState.windows ||= [];
|
||||
initialState.windows.push({
|
||||
tabs: [],
|
||||
});
|
||||
}
|
||||
return initialState;
|
||||
}
|
||||
@@ -291,6 +319,9 @@ export class nsZenSessionManager {
|
||||
* The initial session state read from the session file, possibly modified by onFileRead.
|
||||
*/
|
||||
onCrashCheckpoints(initialState) {
|
||||
if (!lazy.gWindowSyncEnabled) {
|
||||
return;
|
||||
}
|
||||
// When we don't have browser.startup.page set to resume session,
|
||||
// we only want to restore the pinned tabs into the new windows.
|
||||
if (this.#shouldRestoreOnlyPinned && !this.#shouldRestoreFromCrash && this.#sidebar?.tabs) {
|
||||
@@ -302,27 +333,18 @@ export class nsZenSessionManager {
|
||||
// Restore all windows with the same sidebar object, this will
|
||||
// guarantee that all tabs, groups, folders and split view data
|
||||
// are properly synced across all windows.
|
||||
const allowRestoreUnsynced = Services.prefs.getBoolPref(
|
||||
"zen.session-store.restore-unsynced-windows",
|
||||
true
|
||||
);
|
||||
if (!this._shouldRunMigration) {
|
||||
this.log(`Restoring Zen session data into ${initialState.windows?.length || 0} windows`);
|
||||
for (let i = 0; i < initialState.windows.length; i++) {
|
||||
let winData = initialState.windows[i];
|
||||
if (winData.isZenUnsynced) {
|
||||
if (!allowRestoreUnsynced) {
|
||||
// We don't wan't to restore any unsynced windows with the sidebar data.
|
||||
this.log("Skipping restore of unsynced window");
|
||||
delete initialState.windows[i];
|
||||
}
|
||||
if (winData.isZenUnsynced || winData.isPrivate || winData.isPopup || winData.isTaskbarTab) {
|
||||
continue;
|
||||
}
|
||||
this.#restoreWindowData(winData);
|
||||
}
|
||||
} else if (initialState) {
|
||||
this.log("Saving windata state after migration");
|
||||
this.saveState(Cu.cloneInto(initialState, {}));
|
||||
this.saveState(Cu.cloneInto(initialState, {}), true);
|
||||
}
|
||||
delete this._shouldRunMigration;
|
||||
}
|
||||
@@ -440,8 +462,11 @@ export class nsZenSessionManager {
|
||||
* Saves the current session state. Collects data and writes to disk.
|
||||
*
|
||||
* @param {object} state The current session state.
|
||||
* @param {boolean} soon Whether to save the file soon or immediately.
|
||||
* If true, the file will be saved asynchronously or when quitting
|
||||
* the app. If false, the file will be saved immediately.
|
||||
*/
|
||||
saveState(state) {
|
||||
saveState(state, soon = false) {
|
||||
let windows = state?.windows || [];
|
||||
windows = windows.filter((win) => this.#isWindowSaveable(win));
|
||||
if (!windows.length) {
|
||||
@@ -450,11 +475,14 @@ export class nsZenSessionManager {
|
||||
return;
|
||||
}
|
||||
this.#collectWindowData(windows);
|
||||
// This would save the data to disk asynchronously or when
|
||||
// quitting the app.
|
||||
// This would save the data to disk asynchronously or when quitting the app.
|
||||
let sidebar = this.#sidebar;
|
||||
this.#file.data = sidebar;
|
||||
this.#file.saveSoon();
|
||||
if (soon) {
|
||||
this.#file.saveSoon();
|
||||
} else {
|
||||
this.#file._save();
|
||||
}
|
||||
this.#debounceRegeneration();
|
||||
this.log(`Saving Zen session data with ${sidebar.tabs?.length || 0} tabs`);
|
||||
}
|
||||
@@ -508,12 +536,12 @@ export class nsZenSessionManager {
|
||||
// Now we need to check if we have exceeded the maximum
|
||||
// number of backups allowed, and delete the oldest ones
|
||||
// if needed.
|
||||
let prefix = PathUtils.join(backupFolder, "zen-sessions-");
|
||||
let files = await IOUtils.getChildren(backupFolder);
|
||||
files = files.filter((file) => file.startsWith("zen-sessions-")).sort();
|
||||
files = files.filter((file) => file.startsWith(prefix)).sort();
|
||||
for (let i = 0; i < files.length - lazy.gMaxSessionBackups; i++) {
|
||||
const fileToDelete = PathUtils.join(backupFolder, files[i].name);
|
||||
this.log(`Deleting old backup file ${files[i].name}`);
|
||||
await IOUtils.remove(fileToDelete);
|
||||
this.log(`Deleting old backup file ${files[i]}`);
|
||||
await IOUtils.remove(files[i]);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("ZenSessionManager: Failed to create session file backups", e);
|
||||
@@ -535,7 +563,7 @@ export class nsZenSessionManager {
|
||||
return;
|
||||
}
|
||||
this.log("Saving closed window session data into Zen session store");
|
||||
this.saveState({ windows: [aWinData] });
|
||||
this.saveState({ windows: [aWinData] }, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,7 +28,7 @@ XPCOMUtils.defineLazyPreferenceGetter(
|
||||
XPCOMUtils.defineLazyPreferenceGetter(lazy, "gShouldLog", "zen.window-sync.log", true);
|
||||
|
||||
const OBSERVING = ["browser-window-before-show", "sessionstore-windows-restored"];
|
||||
const INSTANT_EVENTS = ["SSWindowClosing"];
|
||||
const INSTANT_EVENTS = ["SSWindowClosing", "TabSelect", "focus"];
|
||||
const UNSYNCED_WINDOW_EVENTS = ["TabOpen"];
|
||||
const EVENTS = [
|
||||
"TabClose",
|
||||
@@ -47,12 +47,12 @@ const EVENTS = [
|
||||
"TabGroupRemoved",
|
||||
"TabGroupMoved",
|
||||
|
||||
"TabHide",
|
||||
"TabShow",
|
||||
|
||||
"ZenTabRemovedFromSplit",
|
||||
"ZenSplitViewTabsSplit",
|
||||
|
||||
"TabSelect",
|
||||
|
||||
"focus",
|
||||
...INSTANT_EVENTS,
|
||||
...UNSYNCED_WINDOW_EVENTS,
|
||||
];
|
||||
@@ -81,6 +81,13 @@ class nsZenWindowSync {
|
||||
lastHandlerPromise: Promise.resolve(),
|
||||
};
|
||||
|
||||
/**
|
||||
* Promise that resolves when the current docshell swap operation is finished.
|
||||
* Used to avoid multiple simultaneous swap operations that could interfere with each other.
|
||||
* For example, when focusing a window AND selecting a tab at the same time.
|
||||
*/
|
||||
#docShellSwitchPromise = Promise.resolve();
|
||||
|
||||
/**
|
||||
* Map of sync handlers for different event types.
|
||||
* Each handler is a function that takes the event as an argument.
|
||||
@@ -169,7 +176,7 @@ class nsZenWindowSync {
|
||||
log(...args) {
|
||||
if (lazy.gShouldLog) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.info("ZenWindowSync:", ...args);
|
||||
console.debug("ZenWindowSync:", ...args);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,8 +248,6 @@ class nsZenWindowSync {
|
||||
for (let tab of gZenWorkspaces.allStoredTabs) {
|
||||
if (!tab.id) {
|
||||
tab.id = this.#newTabSyncId;
|
||||
// Don't call with await here to avoid blocking the loop.
|
||||
this.#maybeFlushTabState(tab);
|
||||
}
|
||||
if (tab.pinned && !tab._zenPinnedInitialState) {
|
||||
await this.setPinnedTabState(tab);
|
||||
@@ -470,9 +475,6 @@ class nsZenWindowSync {
|
||||
this.#maybeSyncAttributeChange(aOriginalItem, aTargetItem, "zen-workspace-id");
|
||||
this.#syncItemPosition(aOriginalItem, aTargetItem, aWindow);
|
||||
}
|
||||
if (gBrowser.isTab(aTargetItem)) {
|
||||
this.#maybeFlushTabState(aTargetItem);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -716,7 +718,7 @@ class nsZenWindowSync {
|
||||
return;
|
||||
}
|
||||
lazy.TabStateCache.update(aOurTab.linkedBrowser.permanentKey, {
|
||||
history: tabStateEntries,
|
||||
history: Cu.cloneInto(tabStateEntries, {}),
|
||||
});
|
||||
};
|
||||
// Running `swapBrowsersAndCloseOther` doesn't expect us to use the tab after
|
||||
@@ -799,6 +801,7 @@ class nsZenWindowSync {
|
||||
{
|
||||
fullScale: true,
|
||||
fullViewport: true,
|
||||
backgroundColor: "transparent",
|
||||
}
|
||||
);
|
||||
|
||||
@@ -814,17 +817,20 @@ class nsZenWindowSync {
|
||||
};
|
||||
});
|
||||
|
||||
await promiseToWait;
|
||||
this.#createPseudoImageForBrowser(otherBrowser, mySrc);
|
||||
this.#maybeRemovePseudoImageForBrowser(ourBrowser);
|
||||
ourBrowser.removeAttribute("zen-pseudo-hidden");
|
||||
otherBrowser.setAttribute("zen-pseudo-hidden", "true");
|
||||
let promise = this.#createPseudoImageForBrowser(otherBrowser, mySrc);
|
||||
await Promise.all([promiseToWait, promise]);
|
||||
callback();
|
||||
} else {
|
||||
this.#maybeRemovePseudoImageForBrowser(ourBrowser);
|
||||
ourBrowser.removeAttribute("zen-pseudo-hidden");
|
||||
lazy.setTimeout(() => {
|
||||
otherBrowser.setAttribute("zen-pseudo-hidden", "true");
|
||||
ourBrowser.removeAttribute("zen-pseudo-hidden");
|
||||
this.#maybeRemovePseudoImageForBrowser(ourBrowser);
|
||||
ourBrowser.focus();
|
||||
resolve();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
ourBrowser.removeAttribute("zen-pseudo-hidden");
|
||||
this.#maybeRemovePseudoImageForBrowser(ourBrowser);
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
@@ -837,10 +843,25 @@ class nsZenWindowSync {
|
||||
*/
|
||||
#createPseudoImageForBrowser(aBrowser, aSrc) {
|
||||
const doc = aBrowser.ownerDocument;
|
||||
const win = aBrowser.ownerGlobal;
|
||||
const img = doc.createElement("img");
|
||||
img.className = "zen-pseudo-browser-image";
|
||||
img.src = aSrc;
|
||||
let promise = new Promise((resolve) => {
|
||||
if (img.complete) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
let finish = () => {
|
||||
win.requestAnimationFrame(() => {
|
||||
resolve();
|
||||
});
|
||||
};
|
||||
img.onload = finish;
|
||||
img.onerror = finish;
|
||||
});
|
||||
aBrowser.after(img);
|
||||
return promise;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -914,14 +935,8 @@ class nsZenWindowSync {
|
||||
*
|
||||
* @param {Window} aWindow - The window that triggered the event.
|
||||
* @param {object} aPreviousTab - The previously selected tab.
|
||||
* @param {boolean} ignoreSameTab - Indicates if the same tab should be ignored.
|
||||
*/
|
||||
async #onTabSwitchOrWindowFocus(aWindow, aPreviousTab = null, ignoreSameTab = false) {
|
||||
// On some occasions, such as when closing a window, this
|
||||
// function might be called multiple times for the same tab.
|
||||
if (aWindow.gBrowser.selectedTab === this.#lastSelectedTab && !ignoreSameTab) {
|
||||
return;
|
||||
}
|
||||
async #onTabSwitchOrWindowFocus(aWindow, aPreviousTab = null) {
|
||||
let activeBrowsers = aWindow.gBrowser.selectedBrowsers;
|
||||
let activeTabs = activeBrowsers.map((browser) => aWindow.gBrowser.getTabForBrowser(browser));
|
||||
// Ignore previous tabs that are still "active". These scenarios could happen for example,
|
||||
@@ -1136,7 +1151,6 @@ class nsZenWindowSync {
|
||||
if (duringPinning && tab?.splitView) {
|
||||
this.on_ZenSplitViewTabsSplit({ target: tab.group });
|
||||
}
|
||||
this.#maybeFlushTabState(tab);
|
||||
}
|
||||
|
||||
on_ZenTabIconChanged(aEvent) {
|
||||
@@ -1156,6 +1170,34 @@ class nsZenWindowSync {
|
||||
return this.#delegateGenericSyncEvent(aEvent, SYNC_FLAG_LABEL);
|
||||
}
|
||||
|
||||
on_TabHide(aEvent) {
|
||||
const tab = aEvent.target;
|
||||
const window = tab.ownerGlobal;
|
||||
if (lazy.gSyncOnlyPinnedTabs && !tab.pinned) {
|
||||
return;
|
||||
}
|
||||
this.#runOnAllWindows(window, (win) => {
|
||||
const targetTab = this.getItemFromWindow(win, tab.id);
|
||||
if (targetTab) {
|
||||
targetTab.ownerGlobal.gBrowser.hideTab(targetTab);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
on_TabShow(aEvent) {
|
||||
const tab = aEvent.target;
|
||||
const window = tab.ownerGlobal;
|
||||
if (lazy.gSyncOnlyPinnedTabs && !tab.pinned) {
|
||||
return;
|
||||
}
|
||||
this.#runOnAllWindows(window, (win) => {
|
||||
const targetTab = this.getItemFromWindow(win, tab.id);
|
||||
if (targetTab) {
|
||||
targetTab.ownerGlobal.gBrowser.showTab(targetTab);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
on_TabMove(aEvent) {
|
||||
this.#delegateGenericSyncEvent(aEvent, SYNC_FLAG_MOVE);
|
||||
return Promise.resolve();
|
||||
@@ -1214,11 +1256,12 @@ class nsZenWindowSync {
|
||||
});
|
||||
}
|
||||
|
||||
on_focus(aEvent) {
|
||||
async on_focus(aEvent) {
|
||||
if (typeof aEvent.target !== "object") {
|
||||
return;
|
||||
}
|
||||
const { ownerGlobal: window } = aEvent.target;
|
||||
await this.#docShellSwitchPromise;
|
||||
const window = Services.focus.activeWindow;
|
||||
if (
|
||||
!window?.gBrowser ||
|
||||
this.#lastFocusedWindow?.deref() === window ||
|
||||
@@ -1229,17 +1272,21 @@ class nsZenWindowSync {
|
||||
}
|
||||
this.#lastFocusedWindow = new WeakRef(window);
|
||||
this.#lastSelectedTab = new WeakRef(window.gBrowser.selectedTab);
|
||||
return this.#onTabSwitchOrWindowFocus(window);
|
||||
return (this.#docShellSwitchPromise = this.#onTabSwitchOrWindowFocus(window));
|
||||
}
|
||||
|
||||
on_TabSelect(aEvent) {
|
||||
async on_TabSelect(aEvent) {
|
||||
await this.#docShellSwitchPromise;
|
||||
const tab = aEvent.target;
|
||||
if (this.#lastSelectedTab?.deref() === tab) {
|
||||
return;
|
||||
}
|
||||
this.#lastSelectedTab = new WeakRef(tab);
|
||||
const previousTab = aEvent.detail.previousTab;
|
||||
return this.#onTabSwitchOrWindowFocus(aEvent.target.ownerGlobal, previousTab);
|
||||
return (this.#docShellSwitchPromise = this.#onTabSwitchOrWindowFocus(
|
||||
aEvent.target.ownerGlobal,
|
||||
previousTab
|
||||
));
|
||||
}
|
||||
|
||||
on_SSWindowClosing(aEvent) {
|
||||
@@ -1259,21 +1306,26 @@ class nsZenWindowSync {
|
||||
for (let browser of aBrowsers) {
|
||||
const tab = this.#swapedTabsEntriesForWC.get(browser.permanentKey);
|
||||
if (tab) {
|
||||
let win = tab.ownerGlobal;
|
||||
this.log(`Finalizing swap for tab ${tab.id} on window close`);
|
||||
lazy.TabStateCache.update(
|
||||
tab.linkedBrowser.permanentKey,
|
||||
lazy.TabStateCache.get(browser.permanentKey)
|
||||
);
|
||||
let tabData = this.#getTabEntriesFromCache(tab);
|
||||
let activePageData = tabData.entries[tabData.index - 1] || null;
|
||||
try {
|
||||
let win = tab.ownerGlobal;
|
||||
this.log(`Finalizing swap for tab ${tab.id} on window close`);
|
||||
lazy.TabStateCache.update(
|
||||
tab.linkedBrowser.permanentKey,
|
||||
lazy.TabStateCache.get(browser.permanentKey)
|
||||
);
|
||||
let tabData = this.#getTabEntriesFromCache(tab);
|
||||
let activePageData = tabData.entries[tabData.index - 1] || null;
|
||||
|
||||
// If the page has a title, set it. When doing a swap and we still didn't
|
||||
// flush the tab state, the title might not be correct.
|
||||
if (activePageData) {
|
||||
win.gBrowser.setInitialTabTitle(tab, activePageData.title, {
|
||||
isContentTitle: activePageData.title && activePageData.title != activePageData.url,
|
||||
});
|
||||
// If the page has a title, set it. When doing a swap and we still didn't
|
||||
// flush the tab state, the title might not be correct.
|
||||
if (activePageData && win?.gBrowser) {
|
||||
win.gBrowser.setInitialTabTitle(tab, activePageData.title, {
|
||||
isContentTitle: activePageData.title && activePageData.title != activePageData.url,
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
// We might have already closed the window at this point, so just ignore any error.
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1375,7 +1427,7 @@ class nsZenWindowSync {
|
||||
|
||||
return new Promise((resolve) => {
|
||||
lazy.setTimeout(() => {
|
||||
this.#onTabSwitchOrWindowFocus(window, null, /* ignoreSameTab = */ true).finally(resolve);
|
||||
this.#onTabSwitchOrWindowFocus(window, null).finally(resolve);
|
||||
}, 0);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -641,21 +641,6 @@ class nsZenViewSplitter extends nsZenDOMOperatedFeature {
|
||||
}
|
||||
}
|
||||
|
||||
get rearangeActionTarget() {
|
||||
return document.getElementById("urlbar-container");
|
||||
}
|
||||
|
||||
afterRearangeAction() {
|
||||
document.getElementById("zenSplitViewModifier").hidePopup();
|
||||
gZenUIManager.showToast("zen-split-view-modifier-enabled-toast", {
|
||||
descriptionId: "zen-split-view-modifier-enabled-toast-description",
|
||||
});
|
||||
}
|
||||
|
||||
afterRearangeRemove() {
|
||||
gZenUIManager.showToast("zen-split-view-modifier-disabled-toast");
|
||||
}
|
||||
|
||||
toggleWrapperDisplay(value) {
|
||||
const wrapper = this.overlay?.parentNode;
|
||||
if (!wrapper) {
|
||||
@@ -695,9 +680,6 @@ class nsZenViewSplitter extends nsZenDOMOperatedFeature {
|
||||
|
||||
this.tabBrowserPanel.addEventListener("click", this.disableTabRearrangeView);
|
||||
window.addEventListener("keydown", this.disableTabRearrangeView);
|
||||
if (!tabDrag) {
|
||||
this.afterRearangeAction();
|
||||
}
|
||||
}
|
||||
|
||||
disableTabRearrangeView = (event = null) => {
|
||||
@@ -733,10 +715,6 @@ class nsZenViewSplitter extends nsZenDOMOperatedFeature {
|
||||
});
|
||||
this.rearrangeViewEnabled = false;
|
||||
this.rearrangeViewView = null;
|
||||
if (!event?.type === "dragend") {
|
||||
// Don't show toast if exiting from drag
|
||||
this.afterRearangeRemove();
|
||||
}
|
||||
};
|
||||
|
||||
onBrowserDragStart = (event) => {
|
||||
|
||||
@@ -595,6 +595,7 @@ class nsZenPinnedTabManager extends nsZenDOMOperatedFeature {
|
||||
tab = gBrowser.adoptTab(tab, {
|
||||
elementIndex: newIndex,
|
||||
selectTab: tab == draggedTab,
|
||||
spaceId: workspaceId,
|
||||
});
|
||||
if (tab) {
|
||||
++newIndex;
|
||||
|
||||
@@ -297,7 +297,7 @@
|
||||
|
||||
--tab-block-margin: 2px;
|
||||
--tab-selected-bgcolor: light-dark(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.18));
|
||||
--tab-selected-shadow: 0 1px 1px 1px light-dark(rgba(0, 0, 0, 0.09), rgba(0, 0, 0, 0.05)) !important;
|
||||
--tab-selected-shadow: 0 1px 1px 0px light-dark(rgba(0, 0, 0, 0.09), rgba(0, 0, 0, 0.05)) !important;
|
||||
grid-gap: 0 !important;
|
||||
|
||||
&[overflow]::after,
|
||||
@@ -1130,7 +1130,7 @@
|
||||
position: absolute;
|
||||
|
||||
:root[zen-single-toolbar="true"] &:not(:empty) {
|
||||
padding-top: 6px;
|
||||
padding-top: 4px;
|
||||
}
|
||||
|
||||
&[hidden="true"] {
|
||||
|
||||
@@ -182,9 +182,10 @@ export class nsZenThemePicker extends nsZenMultiWindowFeature {
|
||||
"zen-workspace-creation-edit-theme-button"
|
||||
);
|
||||
PanelMultiView.openPopup(this.panel, this.toolbox, {
|
||||
position: "topright topleft",
|
||||
position: "start_before",
|
||||
triggerEvent: event,
|
||||
y: fromForm ? -160 : 0,
|
||||
x: -10,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -159,7 +159,7 @@ class nsZenWorkspaces {
|
||||
}
|
||||
}
|
||||
|
||||
async #afterLoadInit() {
|
||||
#afterLoadInit() {
|
||||
const onResize = (...args) => {
|
||||
requestAnimationFrame(() => {
|
||||
this.onPinnedTabsResize(...args);
|
||||
@@ -523,7 +523,7 @@ class nsZenWorkspaces {
|
||||
|
||||
_handleAppCommand(event) {
|
||||
// note: Dont use this._hoveringSidebar as it's not as reliable as checking for :hover
|
||||
if (!this.workspaceEnabled || !this._hoveringSidebar) {
|
||||
if (!this.workspaceEnabled || !gNavToolbox.matches(":hover")) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -918,7 +918,7 @@ class nsZenWorkspaces {
|
||||
this.#initializeEmptyTab();
|
||||
return (async () => {
|
||||
await this.#waitForPromises();
|
||||
await this.#afterLoadInit();
|
||||
this.#afterLoadInit();
|
||||
await this.workspaceBookmarks();
|
||||
await this.changeWorkspace(activeWorkspace, { onInit: true });
|
||||
this.#fixTabPositions();
|
||||
|
||||
@@ -173,7 +173,6 @@
|
||||
&::before {
|
||||
border-radius: var(--border-radius-medium);
|
||||
background: transparent;
|
||||
transition: background 0.1s;
|
||||
pointer-events: none;
|
||||
content: '';
|
||||
position: absolute;
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
"binaryName": "zen",
|
||||
"version": {
|
||||
"product": "firefox",
|
||||
"version": "147.0.3",
|
||||
"candidate": "147.0.3",
|
||||
"version": "147.0.4",
|
||||
"candidate": "147.0.4",
|
||||
"candidateBuild": 1
|
||||
},
|
||||
"buildOptions": {
|
||||
@@ -20,7 +20,7 @@
|
||||
"brandShortName": "Zen",
|
||||
"brandFullName": "Zen Browser",
|
||||
"release": {
|
||||
"displayVersion": "1.18.5b",
|
||||
"displayVersion": "1.18.9b",
|
||||
"github": {
|
||||
"repo": "zen-browser/desktop"
|
||||
},
|
||||
@@ -54,4 +54,4 @@
|
||||
"licenseType": "MPL-2.0"
|
||||
},
|
||||
"updateHostname": "updates.zen-browser.app"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user