Merge branch 'dev' into media-control

This commit is contained in:
mr. m
2025-03-13 15:00:09 +01:00
committed by GitHub
21 changed files with 265 additions and 92 deletions

View File

@@ -516,31 +516,15 @@ jobs:
commit_user_email: zen-browser-auto@users.noreply.github.com
repository: ./updates-server
- name: Build release README
run: |
echo "# Zen Stable Release" > README.md
echo "This is the stable release of Zen Browser." >> README.md
echo "## Sha256 checksums" >> README.md
echo "```" >> README.md
sha256sum ./zen.source.tar.zst/* >> README.md
sha256sum ./zen.linux-x86_64.tar.xz/* >> README.md
sha256sum ./zen.linux-aarch64.tar.xz/* >> README.md
sha256sum ./zen-x86_64.AppImage/* >> README.md
sha256sum ./zen-x86_64.AppImage.zsync/* >> README.md
sha256sum ./zen-aarch64.AppImage/* >> README.md
sha256sum ./zen-aarch64.AppImage.zsync/* >> README.md
sha256sum ./linux-aarch64.mar/* >> README.md
sha256sum ./.github/workflows/object/windows-x64-signed-x86_64/zen.installer.exe >> README.md
sha256sum ./.github/workflows/object/windows-x64-signed-arm64/zen.installer-arm64.exe >> README.md
sha256sum ./zen.macos-universal.dmg/* >> README.md
echo "```" >> README.md
- name: Generate Release Notes
run: bash .github/workflows/src/generate_release_notes.sh
# If we are on Twilight, we want to just update the Twilight tag's release
- name: Update Twilight tag
if: ${{ inputs.update_branch == 'twilight' }}
uses: softprops/action-gh-release@v2
with:
body_path: README.md
body_path: release_notes.md
files: |
./zen.source.tar.zst/*
./zen.linux-x86_64.tar.xz/*
@@ -579,7 +563,7 @@ jobs:
fail_on_unmatched_files: false
generate_release_notes: false
name: 'Release build - ${{ needs.build-data.outputs.version }} (${{ needs.build-data.outputs.build_date }})'
body_path: README.md
body_path: release_notes.md
files: |
./zen.source.tar.zst/*
./zen.linux-x86_64.tar.xz/*

View File

@@ -0,0 +1,108 @@
#!/usr/bin/env bash
RELEASE_NOTES_URL="https://raw.githubusercontent.com/zen-browser/www/refs/heads/main/src/release-notes/stable.json"
if [ "$RELEASE_BRANCH" = "release" ]; then
RELEASE_TYPE="Stable"
echo "Fetching release notes from GitHub..."
RELEASE_NOTES_JSON=$(curl -s "$RELEASE_NOTES_URL")
if [ -z "$RELEASE_NOTES_JSON" ]; then
echo "Error: Failed to fetch release notes from GitHub"
exit 1
fi
LATEST_RELEASE=$(echo "$RELEASE_NOTES_JSON" | jq -r 'last')
EXTRA_NOTES=$(echo "$LATEST_RELEASE" | jq -r '.extra // ""')
else
RELEASE_TYPE="Twilight"
fi
cat << EOF > "release_notes.md"
# Zen ${RELEASE_TYPE} Release
EOF
if [ "$RELEASE_BRANCH" = "release" ]; then
echo "${EXTRA_NOTES}" >> "release_notes.md"
if echo "$LATEST_RELEASE" | jq -e 'has("features")' > /dev/null; then
cat << EOF >> "release_notes.md"
## New Features
$(echo "$LATEST_RELEASE" | jq -r '.features[] | "- " + .')
EOF
fi
if echo "$LATEST_RELEASE" | jq -e 'has("fixes")' > /dev/null; then
cat << EOF >> "release_notes.md"
## Fixes
EOF
echo "$LATEST_RELEASE" | jq -r '.fixes[] | if type=="object" then "- " + .description + " ([#" + (.issue|tostring) + "](" + "https://github.com/zen-browser/desktop/issues/" + (.issue|tostring) + "))" else "- " + . end' >> "release_notes.md"
fi
if echo "$LATEST_RELEASE" | jq -e 'has("breakingChanges")' > /dev/null; then
cat << EOF >> "release_notes.md"
## Breaking Changes
EOF
echo "$LATEST_RELEASE" | jq -r '.breakingChanges[] | if type=="string" then "- " + . else "- " + .description + " [Learn more](" + .link + ")" end' >> "release_notes.md"
fi
if echo "$LATEST_RELEASE" | jq -e 'has("themeChanges")' > /dev/null; then
cat << EOF >> "release_notes.md"
## Theme Changes
$(echo "$LATEST_RELEASE" | jq -r '.themeChanges[] | "- " + .')
EOF
fi
fi
cat << EOF >> "release_notes.md"
<details>
<summary>File Checksums (SHA-256)</summary>
\`\`\`
EOF
generate_checksum() {
local file=$1
if [ -f "$file" ]; then
echo "Generating checksum for $file"
sha256sum "$file" | awk '{print $1 " " $2}' >> "release_notes.md"
else
echo "Warning: $file not found, skipping checksum"
fi
}
files=(
"./zen.source.tar.zst"
"./zen.linux-x86_64.tar.xz"
"./zen.linux-aarch64.tar.xz"
"./zen-x86_64.AppImage"
"./zen-x86_64.AppImage.zsync"
"./zen-aarch64.AppImage"
"./zen-aarch64.AppImage.zsync"
"./.github/workflows/object/windows-x64-signed-x86_64/zen.win-x86_64.zip"
"./.github/workflows/object/windows-x64-signed-arm64/zen.win-arm64.zip"
"./linux.mar"
"./linux-aarch64.mar"
"./.github/workflows/object/windows-x64-signed-x86_64/windows.mar"
"./.github/workflows/object/windows-x64-signed-arm64/windows-arm64.mar"
"./macos.mar"
"./.github/workflows/object/windows-x64-signed-x86_64/zen.installer.exe"
"./.github/workflows/object/windows-x64-signed-arm64/zen.installer-arm64.exe"
"./zen.macos-universal.dmg"
)
for file in "${files[@]}"; do
generate_checksum "$file"
done
cat << EOF >> "release_notes.md"
\`\`\`
</details>
EOF
echo "Release notes generated: release_notes.md"

14
package-lock.json generated
View File

@@ -9,7 +9,7 @@
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"@zen-browser/surfer": "^1.9.20"
"@zen-browser/surfer": "^1.10.2"
},
"devDependencies": {
"husky": "^9.1.7",
@@ -270,9 +270,9 @@
"integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw=="
},
"node_modules/@zen-browser/surfer": {
"version": "1.9.20",
"resolved": "https://registry.npmjs.org/@zen-browser/surfer/-/surfer-1.9.20.tgz",
"integrity": "sha512-/ZV0+UMg/ZpiyLCtNrIrsU8MELTFinQNRz83lOflImygiRo9eNdv4SqWwuSSTMxBqUzwa3xGiw9dCUYq/QFK5g==",
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/@zen-browser/surfer/-/surfer-1.10.2.tgz",
"integrity": "sha512-ltD4T/OM1JCxvJPssaYqmHAjb/cT8U9DJNg3Hg2QrMJSIXYWugvl61GiGDRS3/SINEaSxZM7A6oOWNjYWthiaQ==",
"dependencies": {
"@resvg/resvg-js": "^1.4.0",
"async-icns": "^1.0.2",
@@ -2810,9 +2810,9 @@
"integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw=="
},
"@zen-browser/surfer": {
"version": "1.9.20",
"resolved": "https://registry.npmjs.org/@zen-browser/surfer/-/surfer-1.9.20.tgz",
"integrity": "sha512-/ZV0+UMg/ZpiyLCtNrIrsU8MELTFinQNRz83lOflImygiRo9eNdv4SqWwuSSTMxBqUzwa3xGiw9dCUYq/QFK5g==",
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/@zen-browser/surfer/-/surfer-1.10.2.tgz",
"integrity": "sha512-ltD4T/OM1JCxvJPssaYqmHAjb/cT8U9DJNg3Hg2QrMJSIXYWugvl61GiGDRS3/SINEaSxZM7A6oOWNjYWthiaQ==",
"requires": {
"@resvg/resvg-js": "^1.4.0",
"async-icns": "^1.0.2",

View File

@@ -41,7 +41,7 @@
},
"homepage": "https://github.com/zen-browser/core#readme",
"dependencies": {
"@zen-browser/surfer": "^1.9.20"
"@zen-browser/surfer": "^1.10.2"
},
"devDependencies": {
"husky": "^9.1.7",

10
scripts/update-surfer.sh Normal file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
# make sure we are on root
if [ ! -f "package.json" ]; then
echo "Please run this script from the root of the project"
exit 1
fi
npm update @zen-browser/surfer
npm i @zen-browser/surfer@latest

View File

@@ -186,6 +186,7 @@ pref('zen.sidebar.data', "{\"data\":\n {\"p1\":{\n \"url\":\"https://www.wikip
pref('zen.sidebar.enabled', true);
pref('zen.sidebar.close-on-blur', true);
pref('zen.sidebar.max-webpanels', 8);
pref('zen.sidebar.use-google-favicons', true);
// Zen Split View
pref('zen.splitView.enable-tab-drop', true);

View File

@@ -48,6 +48,7 @@
openWatermark() {
if (!Services.prefs.getBoolPref('zen.watermark.enabled', false)) {
document.documentElement.removeAttribute('zen-before-loaded');
return;
}
for (let elem of document.querySelectorAll('#browser > *, #urlbar')) {

View File

@@ -19,12 +19,6 @@
text-overflow: ellipsis;
}
@media not (-moz-bool-pref: 'zen.watermark.enabled') {
#zen-watermark {
display: none;
}
}
#customization-footer #customization-toolbar-visibility-button {
display: none !important;
}

View File

@@ -0,0 +1,10 @@
diff --git a/browser/base/moz.build b/browser/base/moz.build
index 636e0841786735a63ddea00e819c0b6f0b8a5d4d..6685d857180944d68bf4f049919f81361084c481 100644
--- a/browser/base/moz.build
+++ b/browser/base/moz.build
@@ -87,3 +87,5 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("windows", "gtk"):
DEFINES["MENUBAR_CAN_AUTOHIDE"] = 1
JAR_MANIFESTS += ["jar.mn"]
+
+DIRS += ["zen-components"]

View File

@@ -211,6 +211,11 @@
return;
}
let { permitUnload } = this.#currentBrowser.permitUnload();
if (!permitUnload) {
return;
}
if (onTabClose && hasFocused && !this.#confirmationTimeout) {
const cancelButton = document.getElementById('zen-glance-sidebar-close');
cancelButton.setAttribute('waitconfirmation', true);
@@ -300,7 +305,6 @@
}
// reset everything
const prevOverlay = this.overlay;
this.browserWrapper = null;
this.overlay = null;
this.contentWrapper = null;
@@ -312,7 +316,7 @@
gBrowser.selectedTab = this.#currentParentTab;
}
this._ignoreClose = true;
gBrowser.removeTab(this.lastCurrentTab, { animate: true });
gBrowser.removeTab(this.lastCurrentTab, { animate: true, skipPermitUnload: true });
gBrowser.tabContainer._invalidateCachedTabs();
this.#currentParentTab.removeAttribute('glance-id');

View File

@@ -27,7 +27,6 @@ class ZenBrowserManagerSidebar extends ZenDOMOperatedFeature {
this.onlySafeWidthAndHeight();
this.initProgressListener();
this.update();
this.close(); // avoid caching
this.tabBox.prepend(this.sidebarWrapper);
this.listenForPrefChanges();
@@ -557,16 +556,18 @@ class ZenBrowserManagerSidebar extends ZenDOMOperatedFeature {
_getWebPanelIcon(url, element) {
let { preferredURI } = Services.uriFixup.getFixupURIInfo(url);
element.setAttribute('image', `page-icon:${preferredURI.spec}`);
fetch(`https://s2.googleusercontent.com/s2/favicons?domain_url=${preferredURI.spec}`).then(async (response) => {
if (response.ok) {
let blob = await response.blob();
let reader = new FileReader();
reader.onload = function () {
element.setAttribute('image', reader.result);
};
reader.readAsDataURL(blob);
}
});
if (Services.prefs.getBoolPref('zen.sidebar.use-google-favicons')) {
fetch(`https://s2.googleusercontent.com/s2/favicons?domain_url=${preferredURI.spec}`).then(async (response) => {
if (response.ok) {
let blob = await response.blob();
let reader = new FileReader();
reader.onload = function () {
element.setAttribute('image', reader.result);
};
reader.readAsDataURL(blob);
}
});
}
}
_getBrowserById(id) {

View File

@@ -36,6 +36,10 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
this._resolveInitialized = resolve;
});
promiseEmptyTabInitialized = new Promise((resolve) => {
this._resolveEmptyTabInitialized = resolve;
});
workspaceIndicatorXUL = `
<hbox class="zen-current-workspace-indicator-icon"></hbox>
<hbox class="zen-current-workspace-indicator-name"></hbox>
@@ -145,6 +149,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
}
_initializeEmptyTab() {
if (Services.prefs.getBoolPref('zen.workspaces.disable_empty_state_for_testing', false)) {
return;
}
this._emptyTab = gBrowser.addTrustedTab('about:blank', { inBackground: true, userContextId: 0, _forZenEmptyTab: true });
}
@@ -603,16 +610,22 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
} catch (e) {
console.error('ZenWorkspaces: Error initializing theme picker', e);
}
this._selectStartPage();
await this._selectStartPage();
this._fixTabPositions();
this._resolveInitialized();
this._clearAnyZombieTabs(); // Dont call with await
}
}
_selectStartPage() {
async _selectStartPage() {
if (Services.prefs.getBoolPref('zen.workspaces.disable_empty_state_for_testing', false)) {
return;
}
const currentTab = gBrowser.selectedTab;
let showed = false;
await this.promiseEmptyTabInitialized;
this._resolveEmptyTabInitialized = null;
this.promiseEmptyTabInitialized = null;
if (currentTab.pinned) {
this.selectEmptyTab();
try {

View File

@@ -0,0 +1,4 @@
BROWSER_CHROME_MANIFESTS += [
"tests/browser.toml",
]

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af66b0495e 100644
index fa96568d366fd3608f9bd583fa793150bd815c8b..89a3d8d63a045433f15fae37c8f5df2a84f01452 100644
--- a/browser/components/tabbrowser/content/tabs.js
+++ b/browser/components/tabbrowser/content/tabs.js
@@ -94,7 +94,7 @@
@@ -11,15 +11,16 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
}
return true;
};
@@ -135,6 +135,7 @@
@@ -135,6 +135,8 @@
this.previewPanel = null;
this.allTabs[0].label = this.emptyTabTitle;
+ this.allTabs[0]._possibleEmptyTab = true;
+ ZenWorkspaces._resolveEmptyTabInitialized();
// Hide the secondary text for locales where it is unsupported due to size constraints.
const language = Services.locale.appLocaleAsBCP47;
@@ -339,7 +340,7 @@
@@ -339,7 +341,7 @@
// and we're not hitting the scroll buttons.
if (
event.button != 0 ||
@@ -28,7 +29,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
event.composedTarget.localName == "toolbarbutton"
) {
return;
@@ -388,6 +389,7 @@
@@ -388,6 +390,7 @@
// Reset the "ignored click" flag
target._ignoredCloseButtonClicks = false;
}
@@ -36,7 +37,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
}
/* Protects from close-tab-button errant doubleclick:
@@ -683,7 +685,7 @@
@@ -683,7 +686,7 @@
if (this.#isContainerVerticalPinnedExpanded(tab)) {
// In expanded vertical mode, the max number of pinned tabs per row is dynamic
// Set this before adjusting dragged tab's position
@@ -45,7 +46,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
let tabsPerRow = 0;
let position = 0;
for (let pinnedTab of pinnedTabs) {
@@ -883,6 +885,10 @@
@@ -883,6 +886,10 @@
}
let draggedTab = event.dataTransfer.mozGetDataAt(TAB_DROP_TYPE, 0);
@@ -56,7 +57,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
if (
(effects == "move" || effects == "copy") &&
this == draggedTab.container &&
@@ -996,6 +1002,18 @@
@@ -996,6 +1003,18 @@
this._tabDropIndicator.hidden = true;
event.stopPropagation();
@@ -75,7 +76,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
if (draggedTab && dropEffect == "copy") {
// copy the dropped tab (wherever it's from)
let newIndex = this._getDropIndex(event);
@@ -1034,10 +1052,11 @@
@@ -1034,10 +1053,11 @@
}
} else {
let pinned = draggedTab.pinned;
@@ -91,7 +92,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
);
let size = this.verticalMode ? "height" : "width";
let screenAxis = this.verticalMode ? "screenY" : "screenX";
@@ -1114,7 +1133,7 @@
@@ -1114,7 +1134,7 @@
let postTransitionCleanup = () => {
tab.removeAttribute("tabdrop-samewindow");
@@ -100,7 +101,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
if (dropIndex !== false) {
gBrowser.moveTabTo(tab, dropIndex);
if (!directionForward) {
@@ -1122,7 +1141,7 @@
@@ -1122,7 +1142,7 @@
}
}
};
@@ -109,7 +110,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
postTransitionCleanup();
} else {
let onTransitionEnd = transitionendEvent => {
@@ -1249,7 +1268,7 @@
@@ -1249,7 +1269,7 @@
return;
}
}
@@ -118,7 +119,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
gBrowser.loadTabs(urls, {
inBackground,
replace,
@@ -1279,13 +1298,23 @@
@@ -1279,13 +1299,23 @@
return;
}
@@ -144,7 +145,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
) {
delete draggedTab._dragData;
return;
@@ -1517,7 +1546,7 @@
@@ -1517,7 +1547,7 @@
}
get newTabButton() {
@@ -153,7 +154,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
}
get verticalMode() {
@@ -1537,28 +1566,40 @@
@@ -1537,28 +1567,40 @@
if (this.#allTabs) {
return this.#allTabs;
}
@@ -202,7 +203,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
return children.filter(node => node.tagName == "tab-group");
}
@@ -1579,7 +1620,7 @@
@@ -1579,7 +1621,7 @@
*/
get visibleTabs() {
if (!this.#visibleTabs) {
@@ -211,7 +212,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
}
return this.#visibleTabs;
}
@@ -1613,10 +1654,8 @@
@@ -1613,10 +1655,8 @@
return this.#focusableItems;
}
@@ -224,7 +225,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
let focusableItems = [];
for (let child of children) {
@@ -1632,6 +1671,7 @@
@@ -1632,6 +1672,7 @@
}
this.#focusableItems = [
@@ -232,7 +233,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
...verticalPinnedTabsContainer.children,
...focusableItems,
];
@@ -1642,6 +1682,7 @@
@@ -1642,6 +1683,7 @@
_invalidateCachedTabs() {
this.#allTabs = null;
this._invalidateCachedVisibleTabs();
@@ -240,7 +241,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
}
_invalidateCachedVisibleTabs() {
@@ -1656,8 +1697,8 @@
@@ -1656,8 +1698,8 @@
#isContainerVerticalPinnedExpanded(tab) {
return (
this.verticalMode &&
@@ -251,7 +252,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
);
}
@@ -1672,7 +1713,7 @@
@@ -1672,7 +1714,7 @@
if (node == null) {
// We have a container for non-tab elements at the end of the scrollbox.
@@ -260,7 +261,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
}
node.before(tab);
@@ -1772,7 +1813,7 @@
@@ -1772,7 +1814,7 @@
// There are separate "new tab" buttons for horizontal tabs toolbar, vertical tabs and
// for when the tab strip is overflowed (which is shared by vertical and horizontal tabs);
// Attach the long click popup to all of them.
@@ -269,7 +270,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
const newTab2 = this.newTabButton;
const newTabVertical = document.getElementById(
"vertical-tabs-newtab-button"
@@ -1855,7 +1896,7 @@
@@ -1855,7 +1897,7 @@
let rect = ele => {
return window.windowUtils.getBoundsWithoutFlushing(ele);
};
@@ -278,7 +279,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
if (tab && rect(tab).width <= this._tabClipWidth) {
this.setAttribute("closebuttons", "activetab");
} else {
@@ -1867,10 +1908,12 @@
@@ -1867,10 +1909,12 @@
_handleTabSelect(aInstant) {
let selectedTab = this.selectedItem;
@@ -291,7 +292,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
selectedTab._notselectedsinceload = false;
}
@@ -1882,7 +1925,7 @@
@@ -1882,7 +1926,7 @@
return;
}
@@ -300,7 +301,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
if (!tabs.length) {
return;
}
@@ -1918,7 +1961,7 @@
@@ -1918,7 +1962,7 @@
if (isEndTab && !this._hasTabTempMaxWidth) {
return;
}
@@ -309,7 +310,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
// Force tabs to stay the same width, unless we're closing the last tab,
// which case we need to let them expand just enough so that the overall
// tabbar width is the same.
@@ -1933,7 +1976,7 @@
@@ -1933,7 +1977,7 @@
let tabsToReset = [];
for (let i = numPinned; i < tabs.length; i++) {
let tab = tabs[i];
@@ -318,7 +319,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
if (!isEndTab) {
// keep tabs the same width
tab.style.transition = "none";
@@ -1999,16 +2042,15 @@
@@ -1999,16 +2043,15 @@
// Move pinned tabs to another container when the tabstrip is toggled to vertical
// and when session restore code calls _positionPinnedTabs; update styling whenever
// the number of pinned tabs changes.
@@ -341,7 +342,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
}
}
@@ -2016,9 +2058,7 @@
@@ -2016,9 +2059,7 @@
}
_resetVerticalPinnedTabs() {
@@ -352,7 +353,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
if (!verticalTabsContainer.children.length) {
return;
@@ -2031,8 +2071,8 @@
@@ -2031,8 +2072,8 @@
}
_positionPinnedTabs() {
@@ -363,7 +364,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
let absPositionHorizontalTabs =
this.overflowing && tabs.length > numPinned && numPinned > 0;
@@ -2041,7 +2081,7 @@
@@ -2041,7 +2082,7 @@
if (this.verticalMode) {
this._updateVerticalPinnedTabs();
@@ -372,7 +373,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
let layoutData = this._pinnedTabsLayoutCache;
let uiDensity = document.documentElement.getAttribute("uidensity");
if (!layoutData || layoutData.uiDensity != uiDensity) {
@@ -2113,7 +2153,7 @@
@@ -2113,7 +2154,7 @@
return;
}
@@ -381,7 +382,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
let directionX = screenX > dragData.animLastScreenX;
let directionY = screenY > dragData.animLastScreenY;
@@ -2121,7 +2161,7 @@
@@ -2121,7 +2162,7 @@
dragData.animLastScreenX = screenX;
let { width: tabWidth, height: tabHeight } =
@@ -390,7 +391,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
let shiftSizeX = tabWidth * movingTabs.length;
let shiftSizeY = tabHeight;
dragData.tabWidth = tabWidth;
@@ -2296,10 +2336,11 @@
@@ -2296,10 +2337,11 @@
}
let pinned = draggedTab.pinned;
@@ -406,7 +407,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
);
if (this.#rtlMode) {
@@ -2348,7 +2389,11 @@
@@ -2348,7 +2390,11 @@
translate = Math.min(Math.max(translate, firstBound), lastBound);
for (let tab of movingTabs) {
@@ -419,7 +420,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
}
dragData.translatePos = translate;
@@ -2484,12 +2529,16 @@
@@ -2484,12 +2530,16 @@
// Shift background tabs to leave a gap where the dragged tab
// would currently be dropped.
for (let tab of tabs) {
@@ -437,7 +438,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
if (tab.group?.tabs[0] == tab) {
tab.group.style.setProperty(
"--tabgroup-dragover-transform",
@@ -2541,8 +2590,9 @@
@@ -2541,8 +2591,9 @@
);
}
@@ -449,7 +450,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
return;
}
@@ -2553,6 +2603,7 @@
@@ -2553,6 +2604,7 @@
tab.style.transform = "";
if (tab.group) {
tab.group.style.removeProperty("--tabgroup-dragover-transform");
@@ -457,7 +458,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
}
tab.removeAttribute("dragover-createGroup");
}
@@ -2604,7 +2655,7 @@
@@ -2604,7 +2656,7 @@
movingTab._moveTogetherSelectedTabsData.newIndex = movingTabNewIndex;
movingTab._moveTogetherSelectedTabsData.animate = false;
};
@@ -466,7 +467,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
postTransitionCleanup();
} else {
let onTransitionEnd = transitionendEvent => {
@@ -2707,9 +2758,9 @@
@@ -2707,9 +2759,9 @@
function newIndex(aTab, index) {
// Don't allow mixing pinned and unpinned tabs.
if (aTab.pinned) {
@@ -478,7 +479,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..a13d501f2f0f190b9dc8fe0ce4f1d7af
}
}
@@ -2793,7 +2844,7 @@
@@ -2793,7 +2845,7 @@
}
_notifyBackgroundTab(aTab) {

View File

@@ -0,0 +1,16 @@
diff --git a/testing/profiles/mochitest/user.js b/testing/profiles/mochitest/user.js
index a4068ac3f61161d014c49d54ae7a3bf886868f1b..84523e9e10d44269172aa6913699ec50def8166e 100644
--- a/testing/profiles/mochitest/user.js
+++ b/testing/profiles/mochitest/user.js
@@ -41,3 +41,11 @@ user_pref("places.history.floodingPrevention.enabled", false);
// permission, and we can open it and wait for the user to give permission, then
// don't do that.
user_pref("geo.prompt.open_system_prefs", false);
+
+user_pref("zen.keyboard.shortcuts.enabled", false);
+user_pref("zen.welcome-screen.seen", true);
+user_pref("zen.tab-unloader.enabled", false);
+user_pref("zen.workspaces.disable_empty_state_for_testing", true);
+user_pref("zen.watermark.enabled", false);
+user_pref("zen.urlbar.replace-newtab", false);
+user_pref("zen.sidebar.use-google-favicons", false); // Crashes on some platforms

View File

@@ -1,8 +1,8 @@
diff --git a/testing/profiles/profileserver/user.js b/testing/profiles/profileserver/user.js
index 19ff7d474f6d22d2d386764e2e6942ce6a324470..40d1906bdebd08510014fd6124be17052248e748 100644
index 19ff7d474f6d22d2d386764e2e6942ce6a324470..a1ed4b51f26f458f965fbc29dfa7b8ad451faf7f 100644
--- a/testing/profiles/profileserver/user.js
+++ b/testing/profiles/profileserver/user.js
@@ -8,3 +8,11 @@
@@ -8,3 +8,12 @@
user_pref("dom.timeout.enable_budget_timer_throttling", false);
// Turn off update
user_pref("app.update.disabledForTesting", true);
@@ -10,7 +10,8 @@ index 19ff7d474f6d22d2d386764e2e6942ce6a324470..40d1906bdebd08510014fd6124be1705
+// zen:
+// Disable some of zen's features to better match the default Firefox experience
+user_pref("zen.workspaces.disabled_for_testing", true);
+user_pref("zen.welcome-screen.enabled", false);
+user_pref("zen.workspaces.disable_empty_state_for_testing", true);
+user_pref("zen.welcome-screen.seen", true);
+user_pref("zen.tab-unloader.enabled", false);
+user_pref("zen.watermark.enabled", false);
+user_pref("zen.glance.enabled", false);

2
tests/browser.toml Normal file
View File

@@ -0,0 +1,2 @@
["browser_zen_workspaces.js"]

View File

@@ -0,0 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
https://creativecommons.org/publicdomain/zero/1.0/ */
'use strict';
add_task(async function test_TODO() {
ok(true, 'TODO: implement the test');
});

15
tests/run.sh Normal file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
# make sure we are on root
if [ ! -f "package.json" ]; then
echo "Please run this script from the root of the project"
exit 1
fi
rm -rf engine/browser/base/zen-components/tests/
npm run import
npm run build:ui
cd ./engine
./mach mochitest browser/base/zen-components/tests
cd ..