diff --git a/.gitattributes b/.gitattributes
index 622b6f29d..83a478f83 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,2 +1 @@
*.patch linguist-language=C++
-.github/workflows/object/*.tar.gz filter=lfs diff=lfs merge=lfs -text
diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml
index d347e6bd0..96139823e 100644
--- a/.github/workflows/alpha.yml
+++ b/.github/workflows/alpha.yml
@@ -53,7 +53,7 @@ jobs:
- name: Bump version
if: ${{ github.event.inputs.update_version == 'true' }}
run: |
- pnpm surfer ci --brand alpha --bump prepatch
+ pnpm surfer ci --brand alpha --bump prerelease
- name: Bump version without new version
if: ${{ github.event.inputs.update_version == 'false' }}
@@ -317,23 +317,16 @@ jobs:
with:
submodules: recursive
token: ${{ secrets.DEPLOY_KEY }}
- lfs: true
- name: Git Pull
run: |
git pull
- git lfs pull
- uses: actions/download-artifact@v4
- name: List
run: find .
- - name: Unpack windows build (.tar.gz)
- run: |
- tar -xvf .github/workflows/object/windows-x64-signed-generic.tar.gz -C .
- tar -xvf .github/workflows/object/windows-x64-signed-specific.tar.gz -C .
-
- name: Clone updates repo
uses: actions/checkout@v4
with:
@@ -348,8 +341,8 @@ jobs:
cp -a ../linux_update_manifest_generic/. updates/
cp -a ../linux_update_manifest_specific/. updates/
- cp -a ../windows-x64-signed-generic/update_manifest/. updates/
- cp -a ../windows-x64-signed-specific/update_manifest/. updates/
+ cp -a ../.github/workflows/object/windows-x64-signed-generic/update_manifest/. updates/
+ cp -a ../.github/workflows/object/windows-x64-signed-specific/update_manifest/. updates/
cp -a ../macos_update_manifest_aarch64/. updates/
cp -a ../macos_update_manifest_x64/. updates/
@@ -376,16 +369,16 @@ jobs:
zen-generic.AppImage.zsync
zen-specific.AppImage
zen-specific.AppImage.zsync
- windows-x64-signed-generic/zen.win-generic.zip
- windows-x64-signed-specific/zen.win-specific.zip
+ .github/workflows/object/windows-x64-signed-generic/zen.win-generic.zip
+ .github/workflows/object/windows-x64-signed-specific/zen.win-specific.zip
linux.mar
linux-generic.mar
- windows-x64-signed-generic/windows-generic.mar
- windows-x64-signed-specific/windows.mar
+ .github/workflows/object/windows-x64-signed-generic/windows-generic.mar
+ .github/workflows/object/windows-x64-signed-specific/windows.mar
macos-x64.mar
macos-aarch64.mar
- windows-x64-signed-specific/zen.installer.exe
- windows-x64-signed-generic/zen.installer-generic.exe
+ .github/workflows/object/windows-x64-signed-specific/zen.installer.exe
+ .github/workflows/object/windows-x64-signed-generic/zen.installer-generic.exe
zen.macos-x64.dmg
zen.macos-aarch64.dmg
diff --git a/.github/workflows/object/windows-x64-signed-generic.tar.gz b/.github/workflows/object/windows-x64-signed-generic.tar.gz
deleted file mode 100644
index e4e2794a4..000000000
--- a/.github/workflows/object/windows-x64-signed-generic.tar.gz
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:805f5d9f727596007dc64057d456e87a2648dff596230ca12af6cf48860843fa
-size 237797081
diff --git a/.github/workflows/object/windows-x64-signed-generic/update_manifest/browser/WINNT_x86_64-msvc-x64/alpha-generic/update.xml b/.github/workflows/object/windows-x64-signed-generic/update_manifest/browser/WINNT_x86_64-msvc-x64/alpha-generic/update.xml
new file mode 100644
index 000000000..fb054ad6c
--- /dev/null
+++ b/.github/workflows/object/windows-x64-signed-generic/update_manifest/browser/WINNT_x86_64-msvc-x64/alpha-generic/update.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.github/workflows/object/windows-x64-signed-generic/update_manifest/browser/WINNT_x86_64-msvc/alpha-generic/update.xml b/.github/workflows/object/windows-x64-signed-generic/update_manifest/browser/WINNT_x86_64-msvc/alpha-generic/update.xml
new file mode 100644
index 000000000..fb054ad6c
--- /dev/null
+++ b/.github/workflows/object/windows-x64-signed-generic/update_manifest/browser/WINNT_x86_64-msvc/alpha-generic/update.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.github/workflows/object/windows-x64-signed-generic/windows-generic.mar b/.github/workflows/object/windows-x64-signed-generic/windows-generic.mar
new file mode 100644
index 000000000..e6585be2f
Binary files /dev/null and b/.github/workflows/object/windows-x64-signed-generic/windows-generic.mar differ
diff --git a/.github/workflows/object/windows-x64-signed-generic/zen.installer-generic.exe b/.github/workflows/object/windows-x64-signed-generic/zen.installer-generic.exe
new file mode 100644
index 000000000..ccb8e7109
Binary files /dev/null and b/.github/workflows/object/windows-x64-signed-generic/zen.installer-generic.exe differ
diff --git a/.github/workflows/object/windows-x64-signed-generic/zen.win-generic.zip b/.github/workflows/object/windows-x64-signed-generic/zen.win-generic.zip
new file mode 100644
index 000000000..df89ace0b
Binary files /dev/null and b/.github/workflows/object/windows-x64-signed-generic/zen.win-generic.zip differ
diff --git a/.github/workflows/object/windows-x64-signed-specific.tar.gz b/.github/workflows/object/windows-x64-signed-specific.tar.gz
deleted file mode 100644
index 50be1c3b8..000000000
--- a/.github/workflows/object/windows-x64-signed-specific.tar.gz
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:51d3bb5508804e438755658157f0f18331675b418bdb11db485f938a4fc5fd8a
-size 237484305
diff --git a/.github/workflows/object/windows-x64-signed-specific/update_manifest/browser/WINNT_x86_64-msvc-x64/alpha/update.xml b/.github/workflows/object/windows-x64-signed-specific/update_manifest/browser/WINNT_x86_64-msvc-x64/alpha/update.xml
new file mode 100644
index 000000000..f9974e93f
--- /dev/null
+++ b/.github/workflows/object/windows-x64-signed-specific/update_manifest/browser/WINNT_x86_64-msvc-x64/alpha/update.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.github/workflows/object/windows-x64-signed-specific/update_manifest/browser/WINNT_x86_64-msvc/alpha/update.xml b/.github/workflows/object/windows-x64-signed-specific/update_manifest/browser/WINNT_x86_64-msvc/alpha/update.xml
new file mode 100644
index 000000000..f9974e93f
--- /dev/null
+++ b/.github/workflows/object/windows-x64-signed-specific/update_manifest/browser/WINNT_x86_64-msvc/alpha/update.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.github/workflows/object/windows-x64-signed-specific/windows.mar b/.github/workflows/object/windows-x64-signed-specific/windows.mar
new file mode 100644
index 000000000..2dd8b1319
Binary files /dev/null and b/.github/workflows/object/windows-x64-signed-specific/windows.mar differ
diff --git a/.github/workflows/object/windows-x64-signed-specific/zen.installer.exe b/.github/workflows/object/windows-x64-signed-specific/zen.installer.exe
new file mode 100644
index 000000000..70d73a035
Binary files /dev/null and b/.github/workflows/object/windows-x64-signed-specific/zen.installer.exe differ
diff --git a/.github/workflows/object/windows-x64-signed-specific/zen.win-specific.zip b/.github/workflows/object/windows-x64-signed-specific/zen.win-specific.zip
new file mode 100644
index 000000000..c60429b72
Binary files /dev/null and b/.github/workflows/object/windows-x64-signed-specific/zen.win-specific.zip differ
diff --git a/README.md b/README.md
index a0c112610..91dd1227c 100644
--- a/README.md
+++ b/README.md
@@ -40,6 +40,24 @@ Zen is built with performance in mind, and we have optimized the browser to be a
Zen is available for Linux, macOS, and Windows. You can download the latest version from the official website at [zen-browser.app](https://zen-browser.app/download), or from the [GitHub Releases](https://github.com/zen-browser/desktop/releases) page.
+### Windows
+
+#### Winget
+
+- Generic
+
+```
+winget install --id Zen-Team.Zen-Browser
+```
+
+- Optimized
+
+```
+winget install --id Zen-Team.Zen-Browser.Optimized
+```
+
+####
+
### macOS
- Requires macOS 10.15 or later
diff --git a/build/winsign/sign.ps1 b/build/winsign/sign.ps1
index 62e84fa8a..f50df3da5 100644
--- a/build/winsign/sign.ps1
+++ b/build/winsign/sign.ps1
@@ -28,14 +28,17 @@ function SignAndPackage($name) {
$files = Get-ChildItem engine\obj-x86_64-pc-windows-msvc\ -Recurse -Include *.exe
$files += Get-ChildItem engine\obj-x86_64-pc-windows-msvc\ -Recurse -Include *.dll
- signtool.exe sign /n "$SignIdentity" /t http://time.certum.pl/ /fd sha1 /v $files
+ signtool.exe sign /n "$SignIdentity" /t http://time.certum.pl/ /fd sha256 /v $files
echo "Packaging $name"
$env:SURFER_SIGNING_MODE="sign"
$env:MAR="$PWD\\build\\winsign\\mar.exe"
if ($name -eq "generic") {
$env:SURFER_COMPAT="true"
+ } else {
+ rm env:SURFER_COMPAT -ErrorAction SilentlyContinue
}
+ echo "Compat Mode? $env:SURFER_COMPAT"
pnpm surfer package --verbose
# In the release script, we do the following:
@@ -67,13 +70,22 @@ function SignAndPackage($name) {
# Move the zip
mv (Get-Item .\dist\*.en-US.win64.zip) windsign-temp\windows-x64-signed-$name\zen.win-$name.zip
+ # Extract the zip, sign everything inside, and repackage it
+ Expand-Archive -Path windsign-temp\windows-x64-signed-$name\zen.win-$name.zip -DestinationPath windsign-temp\windows-x64-signed-$name\zen.win-$name
+ rm windsign-temp\windows-x64-signed-$name\zen.win-$name.zip
+ $files = Get-ChildItem windsign-temp\windows-x64-signed-$name\zen.win-$name -Recurse -Include *.exe
+ $files += Get-ChildItem windsign-temp\windows-x64-signed-$name\zen.win-$name -Recurse -Include *.dll
+ signtool.exe sign /n "$SignIdentity" /t http://time.certum.pl/ /fd sha256 /v $files
+ Compress-Archive -Path windsign-temp\windows-x64-signed-$name\zen.win-$name -DestinationPath windsign-temp\windows-x64-signed-$name\zen.win-$name.zip
+ rmdir windsign-temp\windows-x64-signed-$name\zen.win-$name -Recurse -ErrorAction SilentlyContinue
+
# Move the manifest
- foreach ($file in Get-ChildItem .\dist\update\) {
- mv ".\\dist\\update\\$file" windsign-temp\windows-x64-signed-$name\update_manifest
- }
+ mv .\dist\update\. windsign-temp\windows-x64-signed-$name\update_manifest
echo "Invoking tar for $name"
- tar -czvf .\.github\workflows\object\windows-x64-signed-$name.tar.gz -C .\windsign-temp\windows-x64-signed-$name .
+ # note: We need to sign it into a parent folder, called windows-x64-signed-$name
+ rmdir .\.github\workflows\object\windows-x64-signed-$name -Recurse -ErrorAction SilentlyContinue
+ mv .\windsign-temp\windows-x64-signed-$name .\.github\workflows\object\windows-x64-signed-$name -Force
echo "Finished $name"
}
diff --git a/l10n b/l10n
index 39b011023..49d1e57f7 160000
--- a/l10n
+++ b/l10n
@@ -1 +1 @@
-Subproject commit 39b011023d038fb8bb58eece6113919eb5c52770
+Subproject commit 49d1e57f7bcea61b146034a9b0d5647d7b515d55
diff --git a/package.json b/package.json
index 12d94f376..8cf568030 100644
--- a/package.json
+++ b/package.json
@@ -33,7 +33,7 @@
},
"homepage": "https://github.com/zen-browser/core#readme",
"dependencies": {
- "@zen-browser/surfer": "^1.4.18"
+ "@zen-browser/surfer": "^1.4.20"
},
"devDependencies": {
"husky": "^9.1.5",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 106683d80..001eb000b 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -9,8 +9,8 @@ importers:
.:
dependencies:
'@zen-browser/surfer':
- specifier: ^1.4.18
- version: 1.4.18
+ specifier: ^1.4.20
+ version: 1.4.20
devDependencies:
husky:
specifier: ^9.1.5
@@ -119,8 +119,8 @@ packages:
'@types/node@17.0.45':
resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==}
- '@zen-browser/surfer@1.4.18':
- resolution: {integrity: sha512-NFqF5amqa4TuGFk+uVQNY4FngIvyhXvtZdpHUbU8Oeq3nfKE+bsLUHbFz8j9I5sFLQkuHmCsfTtR5gKA5el4YA==}
+ '@zen-browser/surfer@1.4.20':
+ resolution: {integrity: sha512-M9+Jax/B+UQsebJ0K3BaNEKUi/EelKufvG2frWQ4uVAQF9LzFwyyliS5wbcUTs3Ufit4b8xQK7ddt02DmK/Lng==}
hasBin: true
ansi-escapes@7.0.0:
@@ -1003,7 +1003,7 @@ snapshots:
'@types/node@17.0.45': {}
- '@zen-browser/surfer@1.4.18':
+ '@zen-browser/surfer@1.4.20':
dependencies:
'@resvg/resvg-js': 1.4.0
async-icns: 1.0.2
diff --git a/src/browser/app/profile/zen-browser.js b/src/browser/app/profile/zen-browser.js
index fdbf02435..9b5153e14 100644
--- a/src/browser/app/profile/zen-browser.js
+++ b/src/browser/app/profile/zen-browser.js
@@ -52,7 +52,7 @@ pref('pdfjs.enableHighlightFloatingButton', true);
pref("alerts.showFavicons", true);
-pref("browser.tabs.loadBookmarksInTabs", true);
+pref("browser.tabs.loadBookmarksInTabs", false);
pref('browser.toolbars.bookmarks.visibility', 'never');
// Enable Do Not Track and GPC by default.
@@ -73,20 +73,22 @@ pref('zen.welcomeScreen.seen', false);
pref('zen.tabs.vertical', true);
pref('zen.tabs.vertical.right-side', false);
pref('zen.theme.accent-color', "#aac7ff");
-pref('zen.theme.border-radius', 10); // In pixels
-pref('zen.theme.content-element-separation', 4); // In pixels
+pref('zen.theme.border-radius', 5); // In pixels
+pref('zen.theme.content-element-separation', 8); // In pixels
pref('zen.theme.toolbar-themed', true);
pref('zen.theme.pill-button', false);
pref('zen.view.compact', false);
-pref('zen.view.compact.hide-toolbar', false);
pref('zen.theme.color-prefs.amoled', false);
pref('zen.theme.color-prefs.colorful', false);
+pref('zen.view.compact.hide-tabbar', true);
+pref('zen.view.compact.hide-toolbar', false);
pref('zen.view.compact.toolbar-flash-popup', true);
pref('zen.view.compact.toolbar-flash-popup.duration', 800);
+pref('zen.view.compact.toolbar-hide-after-hover.duration', 1000);
-pref('zen.view.sidebar-height-throttle', 500); // in ms
+pref('zen.view.sidebar-height-throttle', 200); // in ms
pref('zen.view.sidebar-expanded', false);
pref('zen.view.sidebar-expanded.on-hover', false);
pref('zen.view.sidebar-expanded.show-button', true);
@@ -99,7 +101,6 @@ pref('zen.keyboard.shortcuts', ""); // Empty string means default shortcuts
pref('zen.keyboard.shortcuts.disable-firefox', false);
pref('zen.tabs.dim-pending', true);
pref('zen.themes.updated-value-observer', false);
-pref('zen.themes.tabs.legacy-location', false);
// Pref to enable the new profiles (TODO: Check this out!)
//pref("browser.profiles.enabled", true);
@@ -117,6 +118,7 @@ pref('zen.splitView.min-resize-width', 7);
pref('zen.workspaces.enabled', true);
pref('zen.workspaces.hide-default-container-indicator', true);
pref('zen.workspaces.individual-pinned-tabs', true);
+pref('zen.workspaces.show-icon-strip', true);
pref('zen.workspaces.icons', '["🌐", "📁", "📎", "📝", "📅", "📊"]');
// Zen Watermark
@@ -196,10 +198,14 @@ pref("widget.non-native-theme.use-theme-accent", true);
pref("privacy.resistFingerprinting.letterboxing", false);
pref("privacy.resistFingerprinting.letterboxing.dimensions", "");
+// Remove Inspect Accessibity Properties menu
+pref("devtools.accessibility.enabled", false);
+
// Enable GPU by default
pref('gfx.webrender.all', true);
pref('layers.acceleration.force-enabled', true);
pref('media.ffmpeg.vaapi.enabled', true);
+pref('media.ffmpeg.encoder.enabled', true);
pref("media.hardware-video-decoding.enabled", true);
-pref("gfx.canvas.accelerated", true);
\ No newline at end of file
+pref("gfx.canvas.accelerated", true);
diff --git a/src/browser/base/content/ZenStartup.mjs b/src/browser/base/content/ZenStartup.mjs
index b956e7b71..11014c1e7 100644
--- a/src/browser/base/content/ZenStartup.mjs
+++ b/src/browser/base/content/ZenStartup.mjs
@@ -40,6 +40,8 @@
// Disable smooth scroll
gBrowser.tabContainer.arrowScrollbox.smoothScroll = false;
+ ZenWorkspaces.init();
+ gZenUIManager.init();
gZenVerticalTabsManager.init();
gZenCompactModeManager.init();
gZenKeyboardShortcuts.init();
@@ -66,7 +68,7 @@
tabs.style.maxHeight = '0px'; // reset to 0
const toolbarRect = toolbarItems.getBoundingClientRect();
// -5 for the controls padding
- let totalHeight = toolbarRect.height - 15;
+ let totalHeight = toolbarRect.height - 5;
// remove the height from other elements that aren't hidden
const otherElements = document.querySelectorAll('#tabbrowser-tabs > *:not([hidden="true"])');
for (let tab of otherElements) {
@@ -75,14 +77,6 @@
}
tabs.style.maxHeight = totalHeight + 'px';
//console.info('ZenThemeModifier: set tabs max-height to', totalHeight + 'px');
-
- const allTabs = document.getElementById('alltabs-button');
- allTabs.removeAttribute('hidden');
- allTabs.removeAttribute('badged');
- allTabs.setAttribute('class', 'toolbarbutton-1 zen-sidebar-action-button');
- document.getElementById('zen-sidebar-icons-wrapper').prepend(
- allTabs
- );
},
openWatermark() {
@@ -107,10 +101,6 @@
_changeSidebarLocation() {
const legacyLocation = Services.prefs.getBoolPref('zen.themes.tabs.legacy-location', false);
const kElementsToAppend = ['sidebar-splitter', 'sidebar-box'];
- if (legacyLocation) {
- kElementsToAppend.push('navigator-toolbox');
- window.document.documentElement.setAttribute('zen-sidebar-legacy', 'true');
- }
const wrapper = document.getElementById('zen-tabbox-wrapper');
const appWrapepr = document.getElementById('zen-sidebar-box-container');
for (let id of kElementsToAppend) {
@@ -123,9 +113,7 @@
const browser = document.getElementById('browser');
const toolbox = document.getElementById('navigator-toolbox');
- if (!legacyLocation) {
- browser.prepend(toolbox);
- }
+ browser.prepend(toolbox);
// remove all styles except for the width, since we are xulstoring the complet style list
const width = toolbox.style.width;
@@ -139,6 +127,102 @@
splitter.setAttribute('resizebefore', 'sibling');
splitter.setAttribute('resizeafter', 'none');
toolbox.insertAdjacentElement('afterend', splitter);
+
+ this._addSidebarButtons();
+ this._hideToolbarButtons();
+ },
+
+ _moveWindowButtons() {
+ const windowControls = document.getElementsByClassName('titlebar-buttonbox-container')[0];
+ const toolboxIcons = document.getElementById('zen-sidebar-top-buttons-customization-target');
+ if (AppConstants.platform === "macosx") {
+ toolboxIcons.prepend(windowControls);
+ }
+ },
+
+ _hideToolbarButtons() {
+ const elementsToHide = [
+ 'alltabs-button',
+ ];
+ for (let id of elementsToHide) {
+ const elem = document.getElementById(id);
+ if (elem) {
+ elem.setAttribute('hidden', 'true');
+ }
+ }
+ },
+
+ _addSidebarButtons() {
+ const sidebarBox = window.MozXULElement.parseXULToFragment(`
+
+ `);
+ document.getElementById('navigator-toolbox').prepend(sidebarBox);
+ const sideBarTopButtons = document.getElementById('zen-sidebar-top-buttons')
+ .querySelector('#zen-sidebar-top-buttons-customization-target');
+
+ const newTab = document.getElementById('vertical-tabs-newtab-button');
+ newTab.classList.add('zen-sidebar-action-button');
+
+ setTimeout(() => {
+ CustomizableUI.registerArea(
+ "zen-sidebar-top-buttons",
+ {
+ type: CustomizableUI.TYPE_TOOLBAR,
+ defaultPlacements: [
+ "PanelUI-menu-button", "zen-expand-sidebar-button", "zen-profile-button"
+ ],
+ defaultCollapsed: null,
+ }
+ );
+ CustomizableUI.registerToolbarNode(
+ document.getElementById('zen-sidebar-top-buttons')
+ );
+
+ const panelMenu = document.getElementById('PanelUI-menu-button');
+ panelMenu.classList.add('zen-sidebar-action-button');
+ panelMenu.setAttribute('cui-areatype', 'toolbar');
+
+ sideBarTopButtons.prepend(panelMenu);
+
+ const defaultSidebarIcons = [
+ 'zen-sidepanel-button',
+ 'zen-workspaces-button',
+ 'new-tab-button'
+ ];
+ for (let id of defaultSidebarIcons) {
+ const elem = document.getElementById(id);
+ if (id === 'zen-workspaces-button' || !elem) continue;
+ elem.setAttribute('removable', 'true');
+ }
+ CustomizableUI.registerArea(
+ "zen-sidebar-icons-wrapper",
+ {
+ type: CustomizableUI.TYPE_TOOLBAR,
+ defaultPlacements: defaultSidebarIcons,
+ defaultCollapsed: null,
+ }
+ );
+ CustomizableUI.registerToolbarNode(
+ document.getElementById('zen-sidebar-icons-wrapper')
+ );
+
+ this._moveWindowButtons();
+ }, 100);
},
_focusSearchBar() {
diff --git a/src/browser/base/content/ZenUIManager.mjs b/src/browser/base/content/ZenUIManager.mjs
index 40d87ef70..52d455be3 100644
--- a/src/browser/base/content/ZenUIManager.mjs
+++ b/src/browser/base/content/ZenUIManager.mjs
@@ -1,4 +1,12 @@
var gZenUIManager = {
+ _popupTrackingElements: [],
+
+ init () {
+
+ document.addEventListener('popupshowing', this.onPopupShowing.bind(this));
+ document.addEventListener('popuphidden', this.onPopupHidden.bind(this));
+ },
+
openAndChangeToTab(url, options) {
if (window.ownerGlobal.parent) {
let tab = window.ownerGlobal.parent.gBrowser.addTrustedTab(url, options);
@@ -24,6 +32,46 @@ var gZenUIManager = {
createValidXULText(text) {
return text.replace(/&/g, '&').replace(//g, '>');
},
+
+ /**
+ * Adds the 'has-popup-menu' attribute to the element when popup is opened on it.
+ * @param element element to track
+ */
+ addPopupTrackingAttribute(element) {
+ this._popupTrackingElements.push(element);
+ },
+
+ removePopupTrackingAttribute(element) {
+ this._popupTrackingElements.remove(element);
+ },
+
+ onPopupShowing(showEvent) {
+ for (const el of this._popupTrackingElements) {
+ if (!el.contains(event.explicitOriginalTarget)) {
+ continue;
+ }
+ document.removeEventListener('mousemove', this.__removeHasPopupAttribute);
+ el.setAttribute('has-popup-menu', '');
+ this.__currentPopup = showEvent.target;
+ this.__currentPopupTrackElement = el;
+ break;
+ }
+ },
+
+ onPopupHidden(hideEvent) {
+ if (!this.__currentPopup || this.__currentPopup !== hideEvent.target) {
+ return;
+ }
+ const element = this.__currentPopupTrackElement;
+ if (document.getElementById('main-window').matches(':hover')) {
+ element.removeAttribute('has-popup-menu');
+ } else {
+ this.__removeHasPopupAttribute = () => element.removeAttribute('has-popup-menu');
+ document.addEventListener('mousemove', this.__removeHasPopupAttribute, {once: true});
+ }
+ this.__currentPopup = null;
+ this.__currentPopupTrackElement = null;
+ },
};
var gZenVerticalTabsManager = {
@@ -33,6 +81,7 @@ var gZenVerticalTabsManager = {
Services.prefs.addObserver('zen.tabs.vertical.right-side', updateEvent);
Services.prefs.addObserver('zen.view.sidebar-expanded.max-width', updateEvent);
Services.prefs.addObserver('zen.view.sidebar-expanded.on-hover', updateEvent);
+ gZenCompactModeManager.addEventListener(updateEvent);
this._updateEvent();
this.initRightSideOrderContextMenu();
},
@@ -72,16 +121,33 @@ var gZenVerticalTabsManager = {
_updateEvent() {
this._updateMaxWidth();
- if (Services.prefs.getBoolPref('zen.view.sidebar-expanded')) {
- this.navigatorToolbox.setAttribute('zen-expanded', 'true');
- } else {
- this.navigatorToolbox.removeAttribute('zen-expanded');
- }
+ const topButtons = document.getElementById('zen-sidebar-top-buttons');
+ const customizationTarget = document.getElementById('nav-bar-customization-target');
+ const tabboxWrapper = document.getElementById('zen-tabbox-wrapper');
+ const browser = document.getElementById('browser');
if (Services.prefs.getBoolPref('zen.tabs.vertical.right-side')) {
this.navigatorToolbox.setAttribute('zen-right-side', 'true');
} else {
this.navigatorToolbox.removeAttribute('zen-right-side');
}
+ if (Services.prefs.getBoolPref('zen.view.sidebar-expanded')) {
+ this.navigatorToolbox.setAttribute('zen-expanded', 'true');
+ } else {
+ this.navigatorToolbox.removeAttribute('zen-expanded');
+ }
+
+ if (this.navigatorToolbox.hasAttribute('zen-expanded') && !this.navigatorToolbox.hasAttribute('zen-right-side')
+ && !Services.prefs.getBoolPref('zen.view.compact') && !Services.prefs.getBoolPref('zen.view.sidebar-expanded.on-hover')) {
+ this.navigatorToolbox.prepend(topButtons);
+ browser.prepend(this.navigatorToolbox);
+ } else {
+ customizationTarget.prepend(topButtons);
+ tabboxWrapper.prepend(this.navigatorToolbox);
+ }
+
+ // Always move the splitter next to the sidebar
+ this.navigatorToolbox.after(document.getElementById('zen-sidebar-splitter'));
+
this._updateOnHoverVerticalTabs();
},
@@ -126,68 +192,3 @@ var gZenVerticalTabsManager = {
Services.prefs.setBoolPref('zen.view.sidebar-expanded.on-hover', false);
},
};
-
-var gZenCompactModeManager = {
- _flashSidebarTimeout: null,
-
- init() {
- Services.prefs.addObserver('zen.view.compact', this._updateEvent.bind(this));
- Services.prefs.addObserver('zen.view.compact.toolbar-flash-popup.duration', this._updatedSidebarFlashDuration.bind(this));
- },
-
- get prefefence() {
- return Services.prefs.getBoolPref('zen.view.compact');
- },
-
- set preference(value) {
- Services.prefs.setBoolPref('zen.view.compact', value);
- },
-
- _updateEvent() {
- Services.prefs.setBoolPref('zen.view.sidebar-expanded.on-hover', false);
- },
-
- toggle() {
- this.preference = !this.prefefence;
- },
-
- _updatedSidebarFlashDuration() {
- this._flashSidebarDuration = Services.prefs.getIntPref('zen.view.compact.toolbar-flash-popup.duration');
- },
-
- toggleSidebar() {
- let sidebar = document.getElementById('navigator-toolbox');
- sidebar.toggleAttribute('zen-user-show');
- },
-
- get flashSidebarDuration() {
- if (this._flashSidebarDuration) {
- return this._flashSidebarDuration;
- }
- return Services.prefs.getIntPref('zen.view.compact.toolbar-flash-popup.duration');
- },
-
- flashSidebar() {
- let sidebar = document.getElementById('navigator-toolbox');
- let tabPanels = document.getElementById('tabbrowser-tabpanels');
- if (sidebar.matches(':hover') || tabPanels.matches("[zen-split-view='true']")) {
- return;
- }
- if (this._flashSidebarTimeout) {
- clearTimeout(this._flashSidebarTimeout);
- } else {
- window.requestAnimationFrame(() => sidebar.setAttribute('flash-popup', ''));
- }
- this._flashSidebarTimeout = setTimeout(() => {
- window.requestAnimationFrame(() => {
- sidebar.removeAttribute('flash-popup');
- this._flashSidebarTimeout = null;
- });
- }, this.flashSidebarDuration);
- },
-
- toggleToolbar() {
- let toolbar = document.getElementById('zen-appcontent-navbar-container');
- toolbar.toggleAttribute('zen-user-show');
- },
-};
diff --git a/src/browser/base/content/zen-assets.inc.xhtml b/src/browser/base/content/zen-assets.inc.xhtml
index 88e141bc5..41068665d 100644
--- a/src/browser/base/content/zen-assets.inc.xhtml
+++ b/src/browser/base/content/zen-assets.inc.xhtml
@@ -26,7 +26,9 @@
\ No newline at end of file
+
diff --git a/src/browser/base/content/zen-assets.jar.inc.mn b/src/browser/base/content/zen-assets.jar.inc.mn
index a75e0cc28..3e828a6b1 100644
--- a/src/browser/base/content/zen-assets.jar.inc.mn
+++ b/src/browser/base/content/zen-assets.jar.inc.mn
@@ -3,7 +3,9 @@
content/browser/zenThemeModifier.js (content/zenThemeModifier.js)
content/browser/ZenStartup.mjs (content/ZenStartup.mjs)
content/browser/ZenUIManager.mjs (content/ZenUIManager.mjs)
+ content/browser/zen-components/ZenCompactMode.mjs (content/zen-components/src/ZenCompactMode.mjs)
content/browser/zen-components/ZenViewSplitter.mjs (content/zen-components/src/ZenViewSplitter.mjs)
+ content/browser/zen-components/ZenThemesCommon.mjs (content/zen-components/src/ZenThemesCommon.mjs)
content/browser/zen-components/ZenWorkspaces.mjs (content/zen-components/src/ZenWorkspaces.mjs)
content/browser/zen-components/ZenSidebarManager.mjs (content/zen-components/src/ZenSidebarManager.mjs)
content/browser/zen-components/ZenProfileDialogUI.mjs (content/zen-components/src/ZenProfileDialogUI.mjs)
diff --git a/src/browser/base/content/zen-components b/src/browser/base/content/zen-components
index b9c35455a..e14fbd8e5 160000
--- a/src/browser/base/content/zen-components
+++ b/src/browser/base/content/zen-components
@@ -1 +1 @@
-Subproject commit b9c35455ad1a299cdb9202dba15c8e1dc3780191
+Subproject commit e14fbd8e5c069abf1717e674712229c67b80d461
diff --git a/src/browser/base/content/zen-sidebar-icons.inc.xhtml b/src/browser/base/content/zen-sidebar-icons.inc.xhtml
index 4b8522959..bb019bbf9 100644
--- a/src/browser/base/content/zen-sidebar-icons.inc.xhtml
+++ b/src/browser/base/content/zen-sidebar-icons.inc.xhtml
@@ -1,9 +1,11 @@
-