Compare commits

..

3 Commits

45 changed files with 319 additions and 553 deletions

View File

@@ -51,6 +51,7 @@ jobs:
echo "update_branch: ${{ inputs.update_branch }}"
echo "GITHUB_REPOSITORY: ${{ github.repository }}"
echo "GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}"
echo "GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}"
echo "GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}"
buildid:
@@ -516,8 +517,6 @@ jobs:
repository: ./updates-server
- name: Generate Release Notes
env:
RELEASE_BRANCH: ${{ inputs.update_branch }}
run: bash .github/workflows/src/generate_release_notes.sh
# If we are on Twilight, we want to just update the Twilight tag's release

View File

@@ -6,7 +6,7 @@
[![Crowdin](https://badges.crowdin.net/zen-browser/localized.svg)](https://crowdin.com/project/zen-browser)
[![Zen Release builds](https://github.com/zen-browser/desktop/actions/workflows/build.yml/badge.svg?branch=stable)](https://github.com/zen-browser/desktop/actions/workflows/build.yml)
✨ Experience tranquillity while browsing the internet with Zen! Our mission is to give you a balance between speed, privacy and productivity!
✨ Experience tranquillity while browsing the web without people tracking you! Zen is a privacy-focused browser that blocks trackers, ads, and other unwanted content while offering the best browsing experience!
<div flex="true">
<a href="https://zen-browser.app/download">
@@ -28,7 +28,7 @@
## 🖥️ Compatibility
Zen is currently built using Firefox version `136.0.2`! 🚀
Zen is currently built using Firefox version `136.0.1`! 🚀
- [`Zen Twilight`](https://zen-browser.app/download?twilight) - Is currently built using Firefox version `RC 136.0`!
- Check out the latest [release notes](https://zen-browser.app/release-notes)!

View File

@@ -1 +1 @@
e234130176d2813fec2397bbf3a313909565006e
6ad0ab3c43a6208d8bcd997b40e802fccd48ba0a

View File

@@ -28,7 +28,7 @@ finish-args:
- --system-talk-name=org.freedesktop.NetworkManager
- --talk-name=org.a11y.Bus
- --env=GTK_PATH=/app/lib/gtkmodules
- --env=MESA_SHADER_CACHE_DIR=/var/cache/mesa_shader_cache_db
- --env=MESA_SHADER_CACHE_DIR=$XDG_RUNTIME_DIR/app/$FLATPAK_ID/cache/mesa_shader_cache_db
modules:
- name: zen_browser
buildsystem: simple

2
l10n

Submodule l10n updated: 778cb128c6...c5a36ae64f

View File

@@ -64,12 +64,6 @@ def update_l10n_last_commit_hash():
if not os.path.exists("firefox-cache"):
os.mkdir("firefox-cache")
os.system("cat l10n-temp/.git/refs/heads/main > firefox-cache/l10n-last-commit-hash")
# Remove new line character
data = ""
with open("firefox-cache/l10n-last-commit-hash", "r") as f:
data = f.read()
with open("firefox-cache/l10n-last-commit-hash", "w") as f:
f.write(data.strip())
except KeyboardInterrupt:
print("Exiting...")
shutil.rmtree("l10n-temp")

View File

@@ -2,11 +2,10 @@ import os
import subprocess
import logging
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s'
)
# Set up logging
logging.basicConfig(level=logging.INFO)
# Constants for paths
NEW_TAB_DIR = "./engine/browser/components/newtab"
ENGINE_DIR = "./engine"
NPM_INSTALL_COMMANDS = ["npm install", "npm install meow@9.0.0"]
@@ -14,62 +13,27 @@ BUNDLE_COMMAND = "npm run bundle --prefix=browser/components/newtab"
def install_dependencies():
if not os.path.isdir(NEW_TAB_DIR):
logging.error(f"Directory not found: {NEW_TAB_DIR}")
raise FileNotFoundError(f"New tab directory {NEW_TAB_DIR} does not exist")
"""Install necessary npm packages for the newtab component."""
for command in NPM_INSTALL_COMMANDS:
try:
logging.info(f"Running command: {command} in {NEW_TAB_DIR}")
subprocess.run(
command.split(),
cwd=NEW_TAB_DIR,
check=True,
capture_output=True,
text=True
)
logging.info(f"Successfully executed: {command}")
except subprocess.CalledProcessError as e:
logging.error(f"Command failed: {command} - {e.stderr}")
raise
logging.info(f"Running command: {command} in {NEW_TAB_DIR}")
subprocess.run(command.split(), cwd=NEW_TAB_DIR, check=True)
def bundle_newtab_components():
if not os.path.isdir(ENGINE_DIR):
logging.error(f"Directory not found: {ENGINE_DIR}")
raise FileNotFoundError(f"Engine directory {ENGINE_DIR} does not exist")
try:
logging.info(f"Bundling newtab components in {ENGINE_DIR}")
result = subprocess.run(
BUNDLE_COMMAND.split(),
cwd=ENGINE_DIR,
check=True,
capture_output=True,
text=True
)
logging.info(f"Bundle completed successfully: {result.stdout}")
except subprocess.CalledProcessError as e:
logging.error(f"Bundle failed: {e.stderr}")
raise
"""Bundle the newtab components."""
logging.info(f"Bundling newtab components in {ENGINE_DIR}")
subprocess.run(BUNDLE_COMMAND.split(), cwd=ENGINE_DIR, check=True)
def update_newtab(init: bool = True):
"""Update the newtab components, optionally initializing dependencies."""
try:
if init:
logging.info("Starting dependency installation")
install_dependencies()
logging.info("Dependencies installed successfully")
logging.info("Starting bundle process")
bundle_newtab_components()
logging.info("Newtab update completed successfully")
except (subprocess.CalledProcessError, FileNotFoundError) as e:
logging.error(f"Update process failed: {str(e)}")
raise
except Exception as e:
logging.error(f"Unexpected error: {str(e)}")
except subprocess.CalledProcessError as e:
logging.error(f"An error occurred: {e}")
raise

View File

@@ -90,8 +90,6 @@ pref('zen.tabs.show-newtab-vertical', true);
pref('zen.view.show-newtab-button-border-top', false);
pref('zen.view.show-newtab-button-top', true);
pref('zen.mediacontrols.enabled', true);
#ifdef MOZILLA_OFFICIAL
pref('zen.rice.api.url', 'https://share.zen-browser.app', locked);
pref('zen.injections.match-urls', 'https://zen-browser.app/*,https://share.zen-browser.app/*', locked);
@@ -201,6 +199,7 @@ pref('zen.startup.smooth-scroll-in-tabs', true);
// Zen Workspaces
pref('zen.workspaces.disabled_for_testing', false);
pref('zen.workspaces.hide-deactivated-workspaces', false);
pref('zen.workspaces.hide-default-container-indicator', true);
pref('zen.workspaces.force-container-workspace', false);
pref('zen.workspaces.open-new-tab-if-last-unpinned-tab-is-closed', false);
@@ -256,7 +255,7 @@ pref('browser.migrate.opera.enabled', true);
// pref('network.trr.mode', 5);
// security: They must enable this themselves, to avoid people downloading malware
pref('xpinstall.signatures.required', true);
pref('xpinstall.signatures.required', false);
// Experimental Zen Features
// Strategy to use for bytecode cache (Thanks https://github.com/gunir)

View File

@@ -250,7 +250,7 @@ var gZenUIManager = {
const toast = this._createToastElement(messageId, options);
this._toastContainer.removeAttribute('hidden');
this._toastContainer.appendChild(toast);
await this.motion.animate(toast, { opacity: [0, 1], scale: [0.8, 1] }, { type: 'spring', bounce: 0.5, duration: 0.7 });
await this.motion.animate(toast, { opacity: [0, 1], scale: [0.8, 1] }, { type: 'spring', bounce: 0.5, duration: 0.5 });
await new Promise((resolve) => setTimeout(resolve, 3000));
await this.motion.animate(toast, { opacity: [1, 0], scale: [1, 0.9] }, { duration: 0.2, bounce: 0 });
const toastHeight = toast.getBoundingClientRect().height;
@@ -265,6 +265,14 @@ var gZenUIManager = {
get panelUIPosition() {
return gZenVerticalTabsManager._hasSetSingleToolbar ? 'bottomleft topleft' : 'bottomright topright';
},
openSettingsWindow() {
window.openDialog(
'chrome://browser/content/zen-components/windows/zen-settings.xhtml',
'_blank',
'centerscreen,chrome,dialog=no,resizable=no,titlebar'
);
},
};
var gZenVerticalTabsManager = {

View File

@@ -52,6 +52,8 @@
content/browser/zen-styles/zen-welcome.css (content/zen-styles/zen-welcome.css)
content/browser/zen-styles/zen-media-controls.css (content/zen-styles/zen-media-controls.css)
content/browser/zen-styles/windows/zen-settings.css (content/zen-styles/windows/zen-settings.css)
content/browser/zen-styles/zen-panels/bookmarks.css (content/zen-styles/zen-panels/bookmarks.css)
content/browser/zen-styles/zen-panels/extensions.css (content/zen-styles/zen-panels/extensions.css)
content/browser/zen-styles/zen-panels/print.css (content/zen-styles/zen-panels/print.css)
@@ -81,3 +83,6 @@
# JS Vendor
content/browser/zen-vendor/tsparticles.confetti.bundle.min.js (content/zen-vendor/tsparticles.confetti.bundle.min.js)
content/browser/zen-vendor/motion.min.mjs (content/zen-vendor/motion.min.mjs)
# Windows
content/browser/zen-components/windows/zen-settings.xhtml (zen-components/windows/zen-settings.xhtml)

View File

@@ -0,0 +1,49 @@
@namespace html 'http://www.w3.org/1999/xhtml';
@namespace xul 'http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul';
* {
margin: 0;
box-sizing: border-box;
}
:root {
font: message-box;
}
body {
width: 100%;
}
#main-content {
background: var(--zen-themed-toolbar-bg-transparent);
@supports (-moz-osx-font-smoothing: auto) {
appearance: -moz-window-titlebar;
}
user-select: none;
touch-action: none;
pointer-events: auto;
width: 100%;
height: 100%;
overflow-x: hidden;
overflow-y: auto;
gap: 2rem;
padding: 1rem;
}
.section {
width: 100%;
position: relative;
gap: 0.6rem;
.section-content {
width: 100%;
background: var(--zen-toolbar-element-bg);
border-radius: 6px;
padding: 1em;
font-size: 1.1em;
}
}

View File

@@ -109,7 +109,7 @@
}
#zen-main-app-wrapper {
background: var(--zen-themed-toolbar-bg-transparent);
background: transparent;
overflow: hidden;
& > * {

View File

@@ -58,11 +58,6 @@ tab-group[split-view-group] {
right: 50%;
transform: translateX(50%);
}
& .tab-content {
min-width: 0;
justify-content: unset !important;
}
}
&:has(> tab:is([visuallyselected], [multiselected])) {

View File

@@ -5,7 +5,7 @@
*/
#PanelUI-zen-gradient-generator {
--panel-width: 320px;
--panel-width: 300px;
--panel-padding: 10px;
min-width: var(--panel-width);
}

View File

@@ -141,6 +141,7 @@
background-color: var(--zen-media-control-bg);
backdrop-filter: saturate(3) contrast(2) blur(10px);
width: 100%;
will-change: transform;
}
.show-on-hover {
@@ -162,7 +163,6 @@
font-size: x-small;
opacity: 0.7;
font-weight: 500;
font-variant-numeric: tabular-nums;
}
}

View File

@@ -351,30 +351,18 @@ menuitem {
#zen-toast-container {
position: fixed;
top: calc(var(--zen-element-separation) * 2);
right: calc(var(--zen-element-separation) * 2);
z-index: 1000;
gap: 1rem;
display: flex;
align-items: end;
:root:not([zen-right-side='true']) & {
right: calc(var(--zen-element-separation) * 2);
}
:root[zen-right-side='true'] & {
left: calc(var(--zen-element-separation) * 2);
}
& .zen-toast {
padding: 0.5rem 0.6rem;
padding: 0.9rem 0.8rem;
border-radius: 12px;
background: linear-gradient(
170deg,
var(--zen-primary-color) -40%,
color-mix(in srgb, var(--zen-primary-color) 85%, #0f0f0f 15%)
);
background: linear-gradient(170deg, light-dark(rgb(187, 187, 187), rgb(240, 240, 240)) -40%, var(--zen-primary-color) 140%);
color: var(--button-primary-color);
box-shadow: 0 0 14px 3px rgba(0, 0, 0, 0.05);
border: 1px solid rgba(0, 0, 0, 0.1);
box-shadow: 0 0 16px 3px rgba(0, 0, 0, 0.1);
display: flex;
font-weight: 500;
gap: 5px;

View File

@@ -111,7 +111,7 @@
background: transparent;
border: none;
cursor: ew-resize;
z-index: 3;
z-index: 2;
&:is(.zen-split-view-splitter[orient='vertical']) {
/* Bit of a hacky solution, but it works */

View File

@@ -269,7 +269,7 @@
}
#tabbrowser-tabs:not([movingtab]) & .tab-content > image:active {
scale: 0.92;
scale: var(--zen-active-tab-scale);
}
& .tab-icon-image {
@@ -474,6 +474,9 @@
}
& #zen-workspaces-button {
margin-left: 2px;
margin-right: 2px;
& .zen-workspace-sidebar-icon[no-icon='true'] {
display: none;
}
@@ -1047,14 +1050,14 @@
#zen-essentials-container {
padding-bottom: var(--zen-toolbox-padding);
overflow: hidden;
gap: calc(var(--zen-toolbox-padding) - 2px);
gap: 3px;
}
#zen-essentials-container {
overflow: hidden;
transition: max-height 0.3s ease-out;
opacity: 1;
grid-template-columns: repeat(auto-fit, minmax(49px, auto));
grid-template-columns: repeat(auto-fit, minmax(48px, auto));
overflow: hidden;
scrollbar-width: thin;
display: grid;
@@ -1106,7 +1109,7 @@
&::after {
content: "";
inset: -50%;
filter: blur(20px);
filter: blur(15px) brightness(1.2);
position: absolute;
background-size: 100% 100%;
background-clip: padding-box;

View File

@@ -158,13 +158,13 @@
--zen-themed-toolbar-bg: light-dark(rgb(240, 240, 244), #171717);
--zen-themed-toolbar-bg-transparent: light-dark(var(--zen-branding-bg), #171717);
--zen-workspace-indicator-height: 48px;
--zen-workspace-indicator-height: 45px;
@media (-moz-windows-mica) or (-moz-platform: macos) {
background: transparent;
--zen-themed-toolbar-bg-transparent: transparent;
@media (-moz-bool-pref: 'zen.widget.windows.acrylic') {
--zen-themed-toolbar-bg-transparent: color-mix(in srgb, var(--zen-themed-toolbar-bg) 35%, transparent 65%);
--zen-themed-toolbar-bg-transparent: color-mix(in srgb, var(--zen-themed-toolbar-bg) 75%, transparent 25%);
}
}

View File

@@ -20,15 +20,13 @@
--toolbarbutton-hover-background: transparent !important;
border-radius: var(--zen-button-border-radius) !important;
background: transparent;
padding: 2px;
appearance: unset !important;
height: fit-content;
gap: 3px;
container-type: inline-size;
width: 100%;
& toolbarbutton {
margin: 0;
margin: auto;
width: 25px;
display: flex;
justify-content: center;
@@ -36,43 +34,8 @@
align-items: center;
position: relative;
& .zen-workspace-icon[no-icon='true'] {
width: 6px;
height: 6px;
background: light-dark(rgba(0, 0, 0, 0.4), rgba(255, 255, 255, 0.4));
border-radius: 50%;
}
filter: grayscale(1);
opacity: 0.5;
transition:
filter 0.2s,
opacity 0.2s,
width 0.1s;
&[active='true'],
&:hover {
filter: grayscale(0);
opacity: 1;
}
&:hover {
background-color: var(--zen-toolbar-element-bg);
}
}
&[overflow] {
gap: 0 !important;
& toolbarbutton {
margin: 0;
}
& toolbarbutton:not([active='true']),
&:has(toolbarbutton:hover) toolbarbutton[active='true'] {
&:not(:hover) {
width: min(var(--zen-overflowed-workspace-button-width), 25px);
@media (-moz-bool-pref: 'zen.workspaces.hide-deactivated-workspaces') {
&:not([active='true']):not(:hover) {
&::after {
content: '';
position: absolute;
@@ -95,6 +58,33 @@
}
}
}
& .zen-workspace-icon[no-icon='true'] {
width: 6px;
height: 6px;
background: light-dark(rgba(0, 0, 0, 0.4), rgba(255, 255, 255, 0.4));
border-radius: 50%;
}
@media not (-moz-bool-pref: 'zen.workspaces.hide-deactivated-workspaces') {
& {
filter: grayscale(1);
opacity: 0.5;
transition:
filter 0.2s,
opacity 0.2s;
}
&[active='true'],
&:hover {
filter: grayscale(0);
opacity: 1;
}
&:hover {
background-color: var(--zen-toolbar-element-bg);
}
}
}
}
@@ -128,11 +118,10 @@
& #zen-workspaces-button {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
display: flex;
gap: 0.5ch;
overflow-x: auto;
scrollbar-width: none;
scroll-behavior: smooth;
}
}
@@ -436,7 +425,7 @@
}
.zen-current-workspace-indicator {
padding: calc(15px + var(--zen-toolbox-padding)) calc(4px + var(--tab-inline-padding));
padding: 15px calc(4px + var(--tab-inline-padding));
font-weight: 600;
position: absolute;
max-height: var(--zen-workspace-indicator-height);
@@ -454,10 +443,11 @@
pointer-events: none;
content: '';
position: absolute;
top: var(--zen-toolbox-padding);
left: calc(var(--zen-toolbox-padding) / 2);
width: calc(100% - var(--zen-toolbox-padding));
height: calc(100% - var(--zen-toolbox-padding) * 2);
top: 4px;
left: 2px;
z-index: -1;
width: calc(100% - 4px);
height: calc(100% - 10px);
}
&:hover,

View File

@@ -394,10 +394,9 @@ var gZenCompactModeManager = {
// When moving the cursor between the url bar and bookmarks, or in-between bookmarks in the bookmark bar, the
// mouseLeave event is triggered without a relatedTarget.
// TODO: Experiment with this for some time, see if people still have issues with the hover state
//if (event.relatedTarget == null) {
// return;
//}
if (event.relatedTarget == null) {
return;
}
// If it's a child element but not the target, ignore the event
if (target.contains(event.explicitOriginalTarget) && event.explicitOriginalTarget !== target) {

View File

@@ -500,9 +500,10 @@
const centerPosition = { x: rect.width / 2, y: rect.height / 2 };
const harmonyAngles = getColorHarmonyType(dots.length + (action === 'add' ? 1 : action === 'remove' ? -1 : 0), this.dots);
this.useAlgo = harmonyAngles.type;
if (!harmonyAngles || harmonyAngles.angles.length === 0) return dots;
this.useAlgo = harmonyAngles.type;
let primaryDot = dots.find((dot) => dot.ID === 0);
if (!primaryDot) return [];
@@ -637,7 +638,7 @@
}
});
let colorPositions = this.calculateCompliments(this.dots, 'remove');
let colorPositions = this.calculateCompliments(this.dots, 'remove', this.useAlgo);
this.handleColorPositions(colorPositions);
this.updateCurrentWorkspace();
return;
@@ -779,7 +780,7 @@
}
});
let colorPositions = this.calculateCompliments(this.dots, 'remove');
let colorPositions = this.calculateCompliments(this.dots, 'remove', this.useAlgo);
this.handleColorPositions(colorPositions);
this.updateCurrentWorkspace();
@@ -869,11 +870,8 @@
if (color.isCustom) {
return color.c;
}
if (forToolbar) {
const toolbarBg = this.getToolbarModifiedBase();
return `color-mix(in srgb, rgb(${color.c[0]}, ${color.c[1]}, ${color.c[2]}) ${this.currentOpacity * 100}%, ${toolbarBg} ${(1 - this.currentOpacity) * 100}%)`;
}
return `rgba(${color.c[0]}, ${color.c[1]}, ${color.c[2]}, ${this.currentOpacity})`;
const toolbarBg = forToolbar ? this.getToolbarModifiedBase() : 'var(--zen-themed-toolbar-bg-transparent)';
return `color-mix(in srgb, rgb(${color.c[0]}, ${color.c[1]}, ${color.c[2]}) ${this.currentOpacity * 100}%, ${toolbarBg} ${(1 - this.currentOpacity) * 100}%)`;
}
getGradient(colors, forToolbar = false) {

View File

@@ -21,8 +21,6 @@ class ZenMediaController {
_controllerSwitchTimeout = null;
init() {
if (!Services.prefs.getBoolPref('zen.mediacontrols.enabled', true)) return;
this.mediaTitle = document.querySelector('#zen-media-title');
this.mediaArtist = document.querySelector('#zen-media-artist');
this.mediaControlBar = document.querySelector('#zen-media-controls-toolbar');
@@ -60,8 +58,16 @@ class ZenMediaController {
}
});
const onTabDiscardedOrClosed = this.onTabDiscardedOrClosed.bind(this);
window.addEventListener('TabClose', onTabDiscardedOrClosed);
window.addEventListener('TabClose', (event) => {
const linkedBrowser = event.target.linkedBrowser;
if (!linkedBrowser?.browsingContext?.mediaController) return;
this.deinitMediaController(
linkedBrowser.browsingContext.mediaController,
true,
linkedBrowser.browserId === this._currentBrowser?.browserId,
true
);
});
window.addEventListener('DOMAudioPlaybackStarted', (event) => {
setTimeout(() => {
@@ -83,17 +89,6 @@ class ZenMediaController {
window.addEventListener('DOMAudioPlaybackStopped', () => this.updateMuteState());
}
onTabDiscardedOrClosed(event) {
const linkedBrowser = event.target.linkedBrowser;
if (!linkedBrowser?.browsingContext?.mediaController) return;
this.deinitMediaController(
linkedBrowser.browsingContext.mediaController,
true,
linkedBrowser.browserId === this._currentBrowser?.browserId,
true
);
}
async deinitMediaController(mediaController, shouldForget = true, shouldOverride = true, shouldHide = true) {
if (!mediaController) return;
@@ -143,7 +138,6 @@ class ZenMediaController {
.then(() => {
this.mediaControlBar.setAttribute('hidden', 'true');
gZenUIManager.updateTabsToolbar();
gZenUIManager.restoreScrollbarState();
});
}
@@ -163,7 +157,6 @@ class ZenMediaController {
this.mediaControlBar.querySelector('toolbaritem').getBoundingClientRect().height + 'px';
this.mediaControlBar.style.opacity = 0;
gZenUIManager.updateTabsToolbar();
gZenUIManager.restoreScrollbarState();
gZenUIManager.motion.animate(
this.mediaControlBar,
{
@@ -192,6 +185,15 @@ class ZenMediaController {
this._currentBrowser = browser;
this.updatePipButton();
const positionState = mediaController.getPositionState();
this.mediaControllersMap.set(mediaController.id, {
controller: mediaController,
browser,
position: positionState.position,
duration: positionState.duration,
lastUpdated: Date.now(),
});
}
setupMediaControlUI(metadata, positionState) {
@@ -208,12 +210,9 @@ class ZenMediaController {
this.mediaArtist.textContent = metadata.artist || '';
gZenUIManager.updateTabsToolbar();
gZenUIManager.restoreScrollbarState();
this._currentPosition = positionState.position;
this._currentDuration = positionState.duration;
this._currentPlaybackRate = positionState.playbackRate;
this.updateMediaPosition();
for (const key of this.supportedKeys) {
@@ -235,7 +234,6 @@ class ZenMediaController {
browser,
position: positionState.position,
duration: positionState.duration,
playbackRate: positionState.playbackRate,
lastUpdated: Date.now(),
});
@@ -279,21 +277,18 @@ class ZenMediaController {
}
_onPositionstateChange(event) {
const mediaController = this.mediaControllersMap.get(event.target.id);
this.mediaControllersMap.set(event.target.id, {
...mediaController,
position: event.position,
duration: event.duration,
playbackRate: event.playbackRate,
lastUpdated: Date.now(),
});
if (event.target.id !== this._currentMediaController?.id) return;
if (event.target.id !== this._currentMediaController?.id) {
const mediaController = this.mediaControllersMap.get(event.target.id);
this.mediaControllersMap.set(event.target.id, {
...mediaController,
position: event.position,
duration: event.duration,
lastUpdated: Date.now(),
});
}
this._currentPosition = event.position;
this._currentDuration = event.duration;
this._currentPlaybackRate = event.playbackRate;
this.updateMediaPosition();
}
@@ -326,7 +321,6 @@ class ZenMediaController {
this.setupMediaControlUI(nextController.controller.getMetadata(), {
position: nextController.position + (nextController.controller.isPlaying ? elapsedTime : 0),
duration: nextController.duration,
playbackRate: nextController.playbackRate,
});
this.showMediaControls();
@@ -355,7 +349,7 @@ class ZenMediaController {
this._mediaUpdateInterval = setInterval(() => {
if (this._currentMediaController?.isPlaying) {
this._currentPosition += 1 * this._currentPlaybackRate;
this._currentPosition += 1;
if (this._currentPosition > this._currentDuration) {
this._currentPosition = this._currentDuration;
}
@@ -390,13 +384,6 @@ class ZenMediaController {
const metadata = event.target.getMetadata();
this.mediaTitle.textContent = metadata.title || '';
this.mediaArtist.textContent = metadata.artist || '';
const mediaInfoElements = [this.mediaTitle, this.mediaArtist];
for (const element of mediaInfoElements) {
element.removeAttribute('overflow');
}
this.addLabelOverflows(mediaInfoElements);
}
_onPictureInPictureModeChange(event) {
@@ -441,10 +428,7 @@ class ZenMediaController {
}
onMediaFocus() {
if (!this._currentBrowser) return;
const sidebarId = this._currentBrowser.getAttribute('zen-sidebar-id');
if (sidebarId) gZenBrowserManagerSidebar.open(sidebarId);
else this._currentMediaController?.focus();
this._currentMediaController?.focus();
}
onMediaMute() {

View File

@@ -510,10 +510,6 @@
case 'unload-switch':
case 'reset-switch':
case 'switch':
let { permitUnload } = selectedTab.linkedBrowser?.permitUnload();
if (!permitUnload) {
return;
}
this._handleTabSwitch(selectedTab);
if (behavior.includes('reset')) {
this._resetTabToStoredState(selectedTab);
@@ -524,7 +520,8 @@
}
// Do not unload about:* pages
if (!selectedTab.linkedBrowser?.currentURI.spec.startsWith('about:')) {
gZenTabUnloader.explicitUnloadTabs([selectedTab], { permitUnload });
gBrowser.explicitUnloadTabs([selectedTab]);
selectedTab.removeAttribute('linkedpanel');
}
}
break;
@@ -834,7 +831,7 @@
removeTabContainersDragoverClass() {
this.dragIndicator.remove();
this._dragIndicator = null;
ZenWorkspaces.activeWorkspaceIndicator?.removeAttribute('open');
ZenWorkspaces.activeWorkspaceIndicator.removeAttribute('open');
}
get dragIndicator() {
@@ -894,9 +891,9 @@
targetTab = targetTab?.group || targetTab;
if (event.target.closest('.zen-current-workspace-indicator')) {
this.removeTabContainersDragoverClass();
ZenWorkspaces.activeWorkspaceIndicator?.setAttribute('open', true);
ZenWorkspaces.activeWorkspaceIndicator.setAttribute('open', true);
} else {
ZenWorkspaces.activeWorkspaceIndicator?.removeAttribute('open');
ZenWorkspaces.activeWorkspaceIndicator.removeAttribute('open');
}
// If there's no valid target tab, nothing to do

View File

@@ -280,10 +280,8 @@ class ZenBrowserManagerSidebar extends ZenDOMOperatedFeature {
this.close();
}
open(id = null) {
open() {
let sidebar = document.getElementById('zen-sidebar-web-panel');
if (id) this._currentPanel = id;
sidebar.removeAttribute('hidden');
this.update();
}

View File

@@ -22,6 +22,8 @@
'TabAttrModified',
'TabPinned',
'TabUnpinned',
'TabBrowserInserted',
'TabBrowserDiscarded',
'TabShow',
'TabHide',
'TabOpen',
@@ -148,6 +150,8 @@
switch (action) {
case 'TabPinned':
case 'TabUnpinned':
case 'TabBrowserInserted':
case 'TabBrowserDiscarded':
case 'TabShow':
case 'TabHide':
break;
@@ -231,9 +235,9 @@
this.explicitUnloadTabs(tabs);
}
explicitUnloadTabs(tabs, extraArgs = {}) {
explicitUnloadTabs(tabs) {
for (let i = 0; i < tabs.length; i++) {
if (this.canUnloadTab(tabs[i], Date.now(), this.intervalUnloader.excludedUrls, true, extraArgs)) {
if (this.canUnloadTab(tabs[i], Date.now(), this.intervalUnloader.excludedUrls, true)) {
this.unload(tabs[i]);
}
}
@@ -255,15 +259,15 @@
}
}
canUnloadTab(tab, currentTimestamp, excludedUrls, ignoreTimestamp = false, extraArgs = {}) {
canUnloadTab(tab, currentTimestamp, excludedUrls, ignoreTimestamp = false) {
if (
(tab.pinned && !ignoreTimestamp) ||
tab.selected ||
(tab.multiselected && !ignoreTimestamp) ||
(tab.hasAttribute('busy') && !ignoreTimestamp) ||
tab.hasAttribute('pending') ||
!tab.linkedPanel ||
tab.splitView ||
tab.group?.hasAttribute('split-view-group') ||
tab.attention ||
tab.hasAttribute('glance-id') ||
tab.linkedBrowser?.zenModeActive ||
@@ -276,7 +280,7 @@
return false;
}
if (ignoreTimestamp) {
return this._tabPermitsUnload(tab, extraArgs);
return true;
}
const lastActivity = tab.lastActivity;
if (!lastActivity) {
@@ -284,13 +288,7 @@
}
const diff = currentTimestamp - lastActivity;
// Check if the tab has been inactive for more than the timeout
return diff > lazy.zenTabUnloaderTimeout * 60 * 1000 && this._tabPermitsUnload(tab, extraArgs);
}
_tabPermitsUnload(tab, extraArgs) {
return typeof extraArgs.permitUnload === 'undefined'
? tab.linkedBrowser?.permitUnload()?.permitUnload
: extraArgs.permitUnload;
return diff > lazy.zenTabUnloaderTimeout * 60 * 1000;
}
}

View File

@@ -230,6 +230,7 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
const halfWidth = panelsWidth / 2;
const side = event.clientX > halfWidth ? 'right' : 'left';
this.fakeBrowser = document.createXULElement('vbox');
this.fakeBrowser.addEventListener('dragleave', this.onBrowserDragEndToSplit);
window.addEventListener('dragend', this.onBrowserDragEndToSplit, { once: true });
const padding = Services.prefs.getIntPref('zen.theme.content-element-separation', 0);
this.fakeBrowser.setAttribute('flex', '1');
@@ -276,7 +277,6 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
]);
if (this._finishAllAnimatingPromise) {
this._finishAllAnimatingPromise.then(() => {
this.fakeBrowser.addEventListener('dragleave', this.onBrowserDragEndToSplit);
this._canDrop = true;
draggedTab._visuallySelected = true;
});
@@ -981,9 +981,7 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
layoutTree: this.calculateLayoutTree(tabs, gridType),
};
this._data.push(splitData);
if (!this._sessionRestoring) {
window.gBrowser.selectedTab = tabs[0];
}
window.gBrowser.selectedTab = tabs[0];
// Add tabs to the split view group
let splitGroup = this._getSplitViewGroup(tabs);
@@ -1724,43 +1722,6 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
return null;
}
storeDataForSessionStore() {
// We cant store any tab or browser elements in the session store
// so we need to store the tab indexes and group indexes
const data = this._data.map((group) => {
return {
groupId: group.tabs[0].group?.id,
gridType: group.gridType,
};
});
return data;
}
restoreDataFromSessionStore(data) {
if (!data) {
return;
}
this._sessionRestoring = true;
// We can just get the tab group with document.getElementById(group.groupId)
// and add the tabs to it
for (const group of data) {
const groupElement = document.getElementById(group.groupId);
if (groupElement) {
const tabs = groupElement.querySelectorAll('tab');
this.splitTabs([...tabs], group.gridType);
}
}
delete this._sessionRestoring;
}
onAfterWorkspaceSessionRestore() {
if (this.currentView >= 0) {
// Activate all browsers in the split view
this.currentView = -1;
this.onLocationChange(gBrowser.selectedTab.linkedBrowser);
}
}
}
window.gZenViewSplitter = new ZenViewSplitter();

View File

@@ -52,6 +52,13 @@
}
}
function openWelcomeTab() {
const tab = window.gBrowser.addTrustedTab('https://zen-browser.app/welcome', {
inBackground: true,
});
gBrowser.selectedTab = tab;
}
class ZenWelcomePages {
constructor(pages) {
this._currentPage = -1;
@@ -403,6 +410,7 @@
_tabsToPinEssentials.push(createdTab);
}
openInitialPinTab();
openWelcomeTab();
},
},
{

View File

@@ -77,8 +77,6 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
);
ChromeUtils.defineLazyGetter(this, 'tabContainer', () => document.getElementById('tabbrowser-tabs'));
this._activeWorkspace = Services.prefs.getStringPref('zen.workspaces.active', '');
window.addEventListener('resize', this.onWindowResize.bind(this));
}
async afterLoadInit() {
@@ -263,13 +261,12 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
_organizeTabsToWorkspaceSections(workspace, section, pinnedSection, tabs) {
const workspaceTabs = Array.from(tabs).filter((tab) => tab.getAttribute('zen-workspace-id') === workspace.uuid);
let firstNormalTab = null;
for (let tab of workspaceTabs) {
for (const tab of workspaceTabs) {
if (tab.hasAttribute('zen-essential')) {
continue; // Ignore essentials as they need to be in their own section
}
// remove tab from list
tabs.splice(tabs.indexOf(tab), 1);
tab = tab.group ?? tab;
if (tab.pinned) {
pinnedSection.insertBefore(tab, pinnedSection.nextSibling);
} else {
@@ -405,7 +402,6 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
_handleSwipeMayStart(event) {
if (!this.workspaceEnabled) return;
if (event.target.closest('#zen-sidebar-bottom-buttons')) return;
// Only handle horizontal swipes
if (event.direction === event.DIRECTION_LEFT || event.direction === event.DIRECTION_RIGHT) {
@@ -603,7 +599,6 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
} catch (e) {
console.error('ZenWorkspaces: Error initializing theme picker', e);
}
this.onWindowResize();
await this._selectStartPage();
this._fixTabPositions();
this._resolveInitialized();
@@ -649,7 +644,6 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
if (gZenVerticalTabsManager._canReplaceNewTab && showed) {
BrowserCommands.openTab();
}
gZenViewSplitter.onAfterWorkspaceSessionRestore();
}
handleInitialTab(tab, isEmpty) {
@@ -876,7 +870,6 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
await ZenWorkspacesStorage.removeWorkspace(windowID);
await this._propagateWorkspaceData();
await this._updateWorkspacesChangeContextMenu();
this.onWindowResize();
}
isWorkspaceActive(workspace) {
@@ -1935,7 +1928,6 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
}
await this.changeWorkspace(workspaceData);
}
this.onWindowResize();
return workspaceData;
}
@@ -2294,11 +2286,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
if (!this._hasInitializedTabsStrip) {
const children = this.tabboxChildren;
children.pop(); // Remove the last child which is the new tab button
return [
...document.querySelectorAll('#zen-essentials-container tab'),
...document.querySelectorAll('#vertical-pinned-tabs-container tab'),
...children,
];
return children;
}
if (this._allStoredTabs) {
@@ -2330,23 +2318,6 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
return this._allStoredTabs;
}
get allTabGroups() {
if (!this._hasInitializedTabsStrip) {
let children = this.tabboxChildren;
return children.filter((node) => node.tagName == 'tab-group');
}
const pinnedContainers = document.querySelectorAll('#vertical-pinned-tabs-container .zen-workspace-tabs-section');
const normalContainers = document.querySelectorAll('#tabbrowser-arrowscrollbox .zen-workspace-tabs-section');
const containers = [...pinnedContainers, ...normalContainers];
const tabGroups = [];
for (const container of containers) {
for (const tabGroup of container.querySelectorAll('tab-group')) {
tabGroups.push(tabGroup);
}
}
return tabGroups;
}
get allUsedBrowsers() {
if (!this._hasInitializedTabsStrip) {
return gBrowser.browsers;
@@ -2397,37 +2368,4 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
const workspace = workspaces.workspaces.find((workspace) => workspace.uuid === activeWorkspace);
return workspace.containerTabId;
}
onWindowResize(event = undefined) {
if (!(!event || event.target === window)) return;
// Check if workspace icons overflow the parent container
const parent = document.getElementById('zen-workspaces-button');
if (!parent || this._processingResize) {
return;
}
this._processingResize = true;
// Once we are overflowing, we align the buttons to always stay inside the container,
// meaning we need to remove the overflow attribute to reset the width
parent.removeAttribute('overflow');
requestAnimationFrame(() => {
const overflow = parent.scrollWidth > parent.clientWidth;
parent.toggleAttribute('overflow', overflow);
// The maximum width a button has when it overflows based on the number of buttons
const numButtons = parent.children.length + 1; // +1 to exclude the active button
const maxWidth = 100 / numButtons;
parent.style.setProperty('--zen-overflowed-workspace-button-width', `${maxWidth}%`);
this._processingResize = false;
// Scroll to the active workspace button if it's not visible
const activeButton = parent.querySelector('.zen-workspace-button.active');
if (!activeButton) {
return;
}
const parentRect = parent.getBoundingClientRect();
const activeRect = activeButton.getBoundingClientRect();
if (activeRect.left < parentRect.left || activeRect.right > parentRect.right) {
parent.scrollLeft = activeButton.offsetLeft;
}
});
}
})();

View File

@@ -50,7 +50,7 @@ export class ZenThemeMarketplaceChild extends JSWindowActorChild {
initiateThemeMarketplace() {
this.contentWindow.setTimeout(() => {
this.addInstallButtons();
this.addIntallButtons();
this.injectMarkplaceAPI();
}, 0);
}
@@ -111,7 +111,7 @@ export class ZenThemeMarketplaceChild extends JSWindowActorChild {
});
}
async addInstallButtons() {
async addIntallButtons() {
const actionButton = this.actionButton;
const actionButtonUnnstall = this.actionButtonUninstall;
const errorMessage = this.contentWindow.document.getElementById('install-theme-error');

View File

@@ -0,0 +1,45 @@
<?xml version="1.0"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- 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/. -->
<html xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
id="zenSettingsWindow"
style="min-width: 35em; max-width: 35em; min-height: 40em;">
<head>
<linkset>
<html:link
rel="stylesheet"
href="chrome://browser/content/zen-styles/zen-theme.css"
/>
<html:link
rel="stylesheet"
href="chrome://browser/content/zen-styles/windows/zen-settings.css"
/>
<html:link rel="localization" href="browser/preferences/preferences.ftl" />
<html:link rel="localization" href="browser/preferences/zen-preferences.ftl" />
</linkset>
<script src="chrome://browser/content/zenThemeModifier.js"></script>
</head>
<html:body xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<vbox id="main-content">
<vbox class="section">
<html:h2 data-l10n-id="pane-general-title"/>
<div class="section-content">
test
</div>
</vbox>
<vbox class="section">
<html:h2 data-l10n-id="pane-general-title"/>
<div class="section-content">
test
</div>
</vbox>
</vbox>
</html:body>
</html>

View File

@@ -959,6 +959,11 @@ Preferences.addAll([
type: 'int',
default: 10,
},
{
id: 'zen.workspaces.hide-deactivated-workspaces',
type: 'bool',
default: true,
},
{
id: 'zen.pinned-tab-manager.restore-pinned-tabs-to-pinned-url',
type: 'bool',

View File

@@ -23,6 +23,9 @@
<checkbox id="zenWorkspacesForceContainerTabsToWorkspace"
data-l10n-id="zen-settings-workspaces-force-container-tabs-to-workspace"
preference="zen.workspaces.force-container-workspace"/>
<checkbox id="zenWorkspaceHideDeactivatedWorkspaces"
data-l10n-id="zen-settings-workspaces-hide-deactivated-workspaces"
preference="zen.workspaces.hide-deactivated-workspaces"/>
</groupbox>
<hbox id="zenTabsUnloadCategory"

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/sessionstore/SessionStore.sys.mjs b/browser/components/sessionstore/SessionStore.sys.mjs
index f814772114948f87cbb3c3a7231c95ea1f68d776..38913eb9dee97b42697440560f7a1bab1ffe9f15 100644
index f814772114948f87cbb3c3a7231c95ea1f68d776..ae35daa518ca25f4fc95ef983519c390bf088a68 100644
--- a/browser/components/sessionstore/SessionStore.sys.mjs
+++ b/browser/components/sessionstore/SessionStore.sys.mjs
@@ -3171,7 +3171,7 @@ var SessionStoreInternal = {
@@ -19,7 +19,7 @@ index f814772114948f87cbb3c3a7231c95ea1f68d776..38913eb9dee97b42697440560f7a1bab
if (inBackground === false) {
aWindow.gBrowser.selectedTab = newTab;
@@ -5355,14 +5356,15 @@ var SessionStoreInternal = {
@@ -5355,14 +5356,14 @@ var SessionStoreInternal = {
}
let tabbrowser = aWindow.gBrowser;
@@ -29,7 +29,6 @@ index f814772114948f87cbb3c3a7231c95ea1f68d776..38913eb9dee97b42697440560f7a1bab
let winData = this._windows[aWindow.__SSi];
let tabsData = (winData.tabs = []);
+ winData.splitViewData = aWindow.gZenViewSplitter?.storeDataForSessionStore();
// update the internal state data for this window
for (let tab of tabs) {
- if (tab == aWindow.FirefoxViewHandler.tab) {
@@ -37,7 +36,7 @@ index f814772114948f87cbb3c3a7231c95ea1f68d776..38913eb9dee97b42697440560f7a1bab
continue;
}
let tabData = lazy.TabState.collect(tab, TAB_CUSTOM_VALUES.get(tab));
@@ -5381,7 +5383,7 @@ var SessionStoreInternal = {
@@ -5381,7 +5382,7 @@ var SessionStoreInternal = {
// We don't store the Firefox View tab in Session Store, so if it was the last selected "tab" when
// 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).
@@ -46,15 +45,7 @@ index f814772114948f87cbb3c3a7231c95ea1f68d776..38913eb9dee97b42697440560f7a1bab
selectedIndex = 1;
winData.title = tabbrowser.tabs[0].label;
}
@@ -5538,6 +5540,7 @@ var SessionStoreInternal = {
winData.tabs,
winData.groups ?? []
);
+ aWindow.gZenViewSplitter?.restoreDataFromSessionStore(winData.splitViewData);
this._log.debug(
`restoreWindow, createTabsForSessionRestore returned ${tabs.length} tabs`
);
@@ -6086,8 +6089,23 @@ var SessionStoreInternal = {
@@ -6086,8 +6087,23 @@ var SessionStoreInternal = {
// Most of tabData has been restored, now continue with restoring
// attributes that may trigger external events.

View File

@@ -1,14 +0,0 @@
diff --git a/browser/components/sessionstore/TabGroupState.sys.mjs b/browser/components/sessionstore/TabGroupState.sys.mjs
index 2406837c67d8ff590aa0db6c75ede81e53097506..b69fb7862cd76c891ef61e29aca8c10bab2f5d7e 100644
--- a/browser/components/sessionstore/TabGroupState.sys.mjs
+++ b/browser/components/sessionstore/TabGroupState.sys.mjs
@@ -66,6 +66,9 @@ class _TabGroupState {
name: tabGroup.label,
color: tabGroup.color,
collapsed: tabGroup.collapsed,
+ pinned: tabGroup.pinned,
+ essential: tabGroup.essential,
+ splitView: tabGroup.hasAttribute("split-view-group"),
};
}

View File

@@ -1,8 +1,13 @@
diff --git a/browser/components/sessionstore/TabState.sys.mjs b/browser/components/sessionstore/TabState.sys.mjs
index 8f7ed557e6aa61e7e16ed4a8d785ad5fe651b3d8..254849e13f7566029dc780c45e376e0f0d427cb5 100644
index 8f7ed557e6aa61e7e16ed4a8d785ad5fe651b3d8..aff63696d198055886960072a6130318e099ae42 100644
--- a/browser/components/sessionstore/TabState.sys.mjs
+++ b/browser/components/sessionstore/TabState.sys.mjs
@@ -84,6 +84,16 @@ class _TabState {
@@ -80,10 +80,20 @@ class _TabState {
tabData.muteReason = tab.muteReason;
}
- if (tab.group) {
+ if (tab.group && !tab.group.hasAttribute("split-view-group")) {
tabData.groupId = tab.group.id;
}

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7409d0582 100644
index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63af1fa8a3 100644
--- a/browser/components/tabbrowser/content/tabbrowser.js
+++ b/browser/components/tabbrowser/content/tabbrowser.js
@@ -412,11 +412,50 @@
@@ -246,24 +246,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
// Additionally send pinned tab events
if (pinned) {
this._notifyPinnedStatus(t);
@@ -2865,12 +2938,15 @@
* @param {string} [label=]
* @returns {MozTabbrowserTabGroup}
*/
- _createTabGroup(id, color, collapsed, label = "") {
+ _createTabGroup(id, color, collapsed, label = "", pinned = false, essential = false, splitViewGroup = false) {
let group = document.createXULElement("tab-group", { is: "tab-group" });
group.id = id;
group.collapsed = collapsed;
group.color = color;
group.label = label;
+ group.pinned = pinned;
+ group.essential = essential;
+ if (splitViewGroup) group.setAttribute('split-view-group', true);
return group;
}
@@ -2904,6 +2980,7 @@
@@ -2904,6 +2977,7 @@
label = "",
insertBefore = null,
showCreateUI = false,
@@ -271,7 +254,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
} = {}
) {
if (!tabs?.length) {
@@ -2918,7 +2995,12 @@
@@ -2918,7 +2992,12 @@
id = `${Date.now()}-${Math.round(Math.random() * 100)}`;
}
let group = this._createTabGroup(id, color, false, label);
@@ -281,11 +264,11 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
+ }
+ group.essential = tabs.some(tab => tab.hasAttribute("essential"));
+ group.pinned = group.essential || tabs.some(tab => tab.pinned);
+ ((insertBefore?.group ?? insertBefore).parentNode).insertBefore(
+ (group.essential ? document.getElementById("zen-essentials-container") : (group.pinned ? this.verticalPinnedTabsContainer : this.tabContainer)).insertBefore(
group,
insertBefore?.group ?? insertBefore
);
@@ -3126,6 +3208,7 @@
@@ -3126,6 +3205,7 @@
initialBrowsingContextGroupId,
openWindowInfo,
skipLoad,
@@ -293,7 +276,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
}
) {
// If we don't have a preferred remote type, and we have a remote
@@ -3189,6 +3272,7 @@
@@ -3189,6 +3269,7 @@
openWindowInfo,
name,
skipLoad,
@@ -301,7 +284,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
});
}
@@ -3367,6 +3451,27 @@
@@ -3367,6 +3448,27 @@
) {
tabWasReused = true;
tab = this.selectedTab;
@@ -329,7 +312,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
if (!tabData.pinned) {
this.unpinTab(tab);
} else {
@@ -3380,6 +3485,7 @@
@@ -3380,6 +3482,7 @@
restoreTabsLazily && !select && !tabData.pinned;
let url = "about:blank";
@@ -337,7 +320,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
if (tabData.entries?.length) {
let activeIndex = (tabData.index || tabData.entries.length) - 1;
// Ensure the index is in bounds.
@@ -3415,7 +3521,27 @@
@@ -3415,7 +3518,27 @@
skipLoad: true,
preferredRemoteType,
});
@@ -366,7 +349,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
if (select) {
tabToSelect = tab;
}
@@ -3428,8 +3554,8 @@
@@ -3428,8 +3551,8 @@
// inserted in the DOM. If the tab is not yet in the DOM,
// just insert it in the right place from the start.
if (!tab.parentNode) {
@@ -377,29 +360,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
tab.toggleAttribute("pinned", true);
this.tabContainer._invalidateCachedTabs();
// Then ensure all the tab open/pinning information is sent.
@@ -3439,7 +3565,8 @@
// needs calling:
shouldUpdateForPinnedTabs = true;
}
- } else if (tabData.groupId) {
+ }
+ if (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
@@ -3453,7 +3580,10 @@
tabGroup.stateData.id,
tabGroup.stateData.color,
tabGroup.stateData.collapsed,
- tabGroup.stateData.name
+ tabGroup.stateData.name,
+ tabGroup.stateData.pinned,
+ tabGroup.stateData.essential,
+ tabGroup.stateData.splitView,
);
tabsFragment.appendChild(tabGroup.node);
}
@@ -3504,6 +3634,9 @@
@@ -3504,6 +3627,9 @@
this.selectedTab = tabToSelect;
this.removeTab(leftoverTab);
}
@@ -409,7 +370,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
if (tabs.length > 1 || !tabs[0].selected) {
this._updateTabsAfterInsert();
@@ -3693,7 +3826,7 @@
@@ -3693,7 +3819,7 @@
// Ensure we have an index if one was not provided.
if (typeof index != "number") {
// Move the new tab after another tab if needed, to the end otherwise.
@@ -418,7 +379,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
if (
!bulkOrderedOpen &&
((openerTab &&
@@ -3736,18 +3869,18 @@
@@ -3736,18 +3862,18 @@
// Ensure index is within bounds.
if (tab.pinned) {
@@ -441,7 +402,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
if (tabAfter && tabAfter.group == tabGroup) {
// Place at the front of, or between tabs in, the same tab group
this.tabContainer.insertBefore(tab, tabAfter);
@@ -4059,6 +4192,9 @@
@@ -4059,6 +4185,9 @@
return;
}
@@ -451,7 +412,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
this.removeTabs(selectedTabs);
}
@@ -4391,6 +4527,7 @@
@@ -4391,6 +4520,7 @@
skipSessionStore,
} = {}
) {
@@ -459,7 +420,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
if (UserInteraction.running("browser.tabs.opening", window)) {
UserInteraction.finish("browser.tabs.opening", window);
}
@@ -4407,6 +4544,12 @@
@@ -4407,6 +4537,12 @@
TelemetryStopwatch.start("FX_TAB_CLOSE_TIME_NO_ANIM_MS", aTab);
}
@@ -472,7 +433,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
// Handle requests for synchronously removing an already
// asynchronously closing tab.
if (!animate && aTab.closing) {
@@ -4421,7 +4564,9 @@
@@ -4421,7 +4557,9 @@
// frame created for it (for example, by updating the visually selected
// state).
let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width;
@@ -483,7 +444,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
if (
!this._beginRemoveTab(aTab, {
closeWindowFastpath: true,
@@ -4435,7 +4580,6 @@
@@ -4435,7 +4573,6 @@
TelemetryStopwatch.cancel("FX_TAB_CLOSE_TIME_NO_ANIM_MS", aTab);
return;
}
@@ -491,7 +452,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
let lockTabSizing =
!this.tabContainer.verticalMode &&
!aTab.pinned &&
@@ -4574,14 +4718,14 @@
@@ -4574,14 +4711,14 @@
!!this.tabsInCollapsedTabGroups.length;
if (
aTab.visible &&
@@ -508,7 +469,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
if (closeWindow) {
// We've already called beforeunload on all the relevant tabs if we get here,
@@ -4605,6 +4749,7 @@
@@ -4605,6 +4742,7 @@
newTab = true;
}
@@ -516,7 +477,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
aTab._endRemoveArgs = [closeWindow, newTab];
// swapBrowsersAndCloseOther will take care of closing the window without animation.
@@ -4645,9 +4790,7 @@
@@ -4645,9 +4783,7 @@
aTab._mouseleave();
if (newTab) {
@@ -527,7 +488,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
} else {
TabBarVisibility.update();
}
@@ -4776,6 +4919,8 @@
@@ -4776,6 +4912,8 @@
this.tabs[i]._tPos = i;
}
@@ -536,7 +497,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
if (!this._windowIsClosing) {
if (wasPinned) {
this.tabContainer._positionPinnedTabs();
@@ -4994,7 +5139,7 @@
@@ -4994,7 +5132,7 @@
!excludeTabs.has(aTab.owner) &&
Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose")
) {
@@ -545,7 +506,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
}
// Try to find a remaining tab that comes after the given tab
@@ -5016,7 +5161,7 @@
@@ -5016,7 +5154,7 @@
}
if (tab) {
@@ -554,7 +515,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
}
// If no qualifying visible tab was found, see if there is a tab in
@@ -5434,10 +5579,10 @@
@@ -5434,10 +5572,10 @@
SessionStore.deleteCustomTabValue(aTab, "hiddenBy");
}
@@ -567,7 +528,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
aTab.selected ||
aTab.closing ||
// Tabs that are sharing the screen, microphone or camera cannot be hidden.
@@ -5675,7 +5820,7 @@
@@ -5675,7 +5813,7 @@
// Don't allow mixing pinned and unpinned tabs.
if (aTab.pinned) {
@@ -576,7 +537,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
} else {
aIndex = Math.max(aIndex, this.pinnedTabCount);
}
@@ -5685,10 +5830,17 @@
@@ -5685,10 +5823,17 @@
this._handleTabMove(aTab, () => {
let neighbor = this.tabs[aIndex];
@@ -596,7 +557,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
neighbor.after(aTab);
} else {
this.tabContainer.insertBefore(aTab, neighbor);
@@ -5697,7 +5849,7 @@
@@ -5697,7 +5842,7 @@
}
moveTabToGroup(aTab, aGroup) {
@@ -605,7 +566,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
return;
}
if (aTab.group && aTab.group.id === aGroup.id) {
@@ -5721,6 +5873,10 @@
@@ -5721,6 +5866,10 @@
moveActionCallback();
@@ -616,7 +577,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
// Clear tabs cache after moving nodes because the order of tabs may have
// changed.
this.tabContainer._invalidateCachedTabs();
@@ -5771,7 +5927,7 @@
@@ -5771,7 +5920,7 @@
createLazyBrowser,
};
@@ -625,7 +586,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
if (aIndex < numPinned || (aTab.pinned && aIndex == numPinned)) {
params.pinned = true;
}
@@ -6513,7 +6669,7 @@
@@ -6513,7 +6662,7 @@
// preventDefault(). It will still raise the window if appropriate.
break;
}
@@ -634,7 +595,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
window.focus();
aEvent.preventDefault();
break;
@@ -7415,6 +7571,7 @@
@@ -7415,6 +7564,7 @@
aWebProgress.isTopLevel
) {
this.mTab.setAttribute("busy", "true");
@@ -642,7 +603,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
gBrowser._tabAttrModified(this.mTab, ["busy"]);
this.mTab._notselectedsinceload = !this.mTab.selected;
}
@@ -8381,7 +8538,7 @@ var TabContextMenu = {
@@ -8381,7 +8531,7 @@ var TabContextMenu = {
);
contextUnpinSelectedTabs.hidden =
!this.contextTab.pinned || !multiselectionContext;
@@ -651,7 +612,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
// Move Tab items
let contextMoveTabOptions = document.getElementById(
"context_moveTabOptions"
@@ -8414,7 +8571,7 @@ var TabContextMenu = {
@@ -8414,7 +8564,7 @@ var TabContextMenu = {
let contextMoveTabToStart = document.getElementById("context_moveToStart");
let isFirstTab =
tabsToMove[0] == visibleTabs[0] ||
@@ -660,7 +621,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
contextMoveTabToStart.disabled = isFirstTab && allSelectedTabsAdjacent;
document.getElementById("context_openTabInWindow").disabled =
@@ -8647,6 +8804,7 @@ var TabContextMenu = {
@@ -8647,6 +8797,7 @@ var TabContextMenu = {
if (this.contextTab.multiselected) {
gBrowser.removeMultiSelectedTabs();
} else {

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
index fa96568d366fd3608f9bd583fa793150bd815c8b..13a870629a98304cb18dc09b5ae075d734668f2a 100644
index fa96568d366fd3608f9bd583fa793150bd815c8b..1c940a3b162919256ca73fa867c5c261a3395e25 100644
--- a/browser/components/tabbrowser/content/tabs.js
+++ b/browser/components/tabbrowser/content/tabs.js
@@ -94,7 +94,7 @@
@@ -145,7 +145,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..13a870629a98304cb18dc09b5ae075d7
}
get verticalMode() {
@@ -1537,29 +1565,41 @@
@@ -1537,28 +1565,40 @@
if (this.#allTabs) {
return this.#allTabs;
}
@@ -189,12 +189,11 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..13a870629a98304cb18dc09b5ae075d7
}
get allGroups() {
let children = Array.from(this.arrowScrollbox.children);
- return children.filter(node => node.tagName == "tab-group");
+ return ZenWorkspaces.allTabGroups;
- let children = Array.from(this.arrowScrollbox.children);
+ let children = ZenWorkspaces.tabboxChildren;
return children.filter(node => node.tagName == "tab-group");
}
/**
@@ -1579,7 +1619,7 @@
*/
get visibleTabs() {

View File

@@ -1,15 +1,8 @@
diff --git a/browser/themes/windows/browser.css b/browser/themes/windows/browser.css
index f49604e53780763b9aa19897458c45f0be6cbc9b..5ea9098a9b689470ef4ddfea91069cd23391d020 100644
index f49604e53780763b9aa19897458c45f0be6cbc9b..aa9da99641ba4a3b7f67a27acbbf6c75c1346ced 100644
--- a/browser/themes/windows/browser.css
+++ b/browser/themes/windows/browser.css
@@ -40,14 +40,13 @@
* override these on the tabs toolbar because the accent color is
* arbitrary, so the hardcoded colors from browser-custom-colors might
* not provide sufficient contrast. */
- --toolbarbutton-icon-fill: currentColor;
--toolbarbutton-hover-background: color-mix(in srgb, currentColor 17%, transparent);
--toolbarbutton-active-background: color-mix(in srgb, currentColor 30%, transparent);
}
@@ -47,7 +47,7 @@
}
&[sizemode="normal"] #navigator-toolbox {

View File

@@ -1,5 +1,5 @@
diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp
index 0b8dee1ca22b1f0ddcf7e6a976f606990104b56e..db31132b67a041abf6bf3e5ed68ab20380fdc293 100644
index 0b8dee1ca22b1f0ddcf7e6a976f606990104b56e..a3a5a7cfcaa8a4719e56988bc917183fa3cc9d10 100644
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -455,6 +455,7 @@ class HTMLMediaElement::MediaControlKeyListener final
@@ -10,13 +10,3 @@ index 0b8dee1ca22b1f0ddcf7e6a976f606990104b56e..db31132b67a041abf6bf3e5ed68ab203
NotifyAudibleStateChanged(mIsOwnerAudible
? MediaAudibleState::eAudible
: MediaAudibleState::eInaudible);
@@ -6952,6 +6953,9 @@ void HTMLMediaElement::FireTimeUpdate(TimeupdateType aType) {
DispatchAsyncEvent(std::move(runner));
mQueueTimeUpdateRunnerTime = TimeStamp::Now();
mLastCurrentTime = CurrentTime();
+ if (aType == TimeupdateType::eMandatory) {
+ mMediaControlKeyListener->NotifyMediaPositionState();
+ }
}
if (mFragmentEnd >= 0.0 && CurrentTime() >= mFragmentEnd) {
Pause();

View File

@@ -1,16 +0,0 @@
diff --git a/toolkit/components/pictureinpicture/content/player.js b/toolkit/components/pictureinpicture/content/player.js
index 9a4971d5d24dba6e543be8ea321c6be8c43ad859..b0788967e51736b1ec95daf96a1504bfd7c1dea7 100644
--- a/toolkit/components/pictureinpicture/content/player.js
+++ b/toolkit/components/pictureinpicture/content/player.js
@@ -722,6 +722,11 @@ let Player = {
document.getElementById("large").click();
break;
}
+
+ case "minimize": {
+ this.closePipWindow({ reason: "CloseButton" });
+ break;
+ }
}
// If the click came from a element that is not inside the subtitles settings panel
// then we want to hide the panel

View File

@@ -1,37 +0,0 @@
diff --git a/toolkit/components/pictureinpicture/content/player.xhtml b/toolkit/components/pictureinpicture/content/player.xhtml
index 440ce51e8e67e4d3a7bdcb78f38f2fb6684c9848..38912579310314a13d516328ec770db6b589d243 100644
--- a/toolkit/components/pictureinpicture/content/player.xhtml
+++ b/toolkit/components/pictureinpicture/content/player.xhtml
@@ -17,6 +17,7 @@
<link rel="localization" href="browser/browserSets.ftl"/>
<script src="chrome://global/content/pictureinpicture/player.js"></script>
<title data-l10n-id="pictureinpicture-player-title"></title>
+ <link rel="localization" href="browser/zen-general.ftl"/>
</head>
<body>
@@ -52,13 +53,22 @@
tabindex="10"
#endif
/>
- <button id="unpip"
- class="control-item control-button tooltip-under-controls" data-l10n-id="pictureinpicture-unpip-btn" data-l10n-attrs="tooltip"
+ <button id="minimize"
+ class="control-item control-button tooltip-under-controls" data-l10n-id="pictureinpicture-minimize-btn" data-l10n-attrs="tooltip"
#ifdef XP_MACOSX
mac="true"
tabindex="10"
#else
tabindex="9"
+#endif
+ />
+ <button id="unpip"
+ class="control-item control-button tooltip-under-controls" data-l10n-id="pictureinpicture-unpip-btn" data-l10n-attrs="tooltip"
+#ifdef XP_MACOSX
+ mac="true"
+ tabindex="11"
+#else
+ tabindex="10"
#endif
/>
<div id="controls-bottom-gradient" class="control-item"></div>

View File

@@ -1,12 +0,0 @@
diff --git a/toolkit/content/widgets/findbar.js b/toolkit/content/widgets/findbar.js
index 8ca512e0b212bb6e25ed37e7edb4f8e2587d5bb0..5abfff92b3a8df5d138082af96419668a2c8a9bb 100644
--- a/toolkit/content/widgets/findbar.js
+++ b/toolkit/content/widgets/findbar.js
@@ -1188,6 +1188,7 @@
* e.g. <command name="cmd_find" oncommand="gFindBar.onFindCommand();"/>
*/
onFindCommand() {
+ if (gBrowser?.selectedTab?.hasAttribute("zen-empty-tab")) return;
return this.startFind(this.FIND_NORMAL);
}

View File

@@ -1,22 +0,0 @@
diff --git a/toolkit/themes/shared/pictureinpicture/player.css b/toolkit/themes/shared/pictureinpicture/player.css
index a3ffe31d47cc81a0cb578acc9177aaa6f41668eb..cf69507804b7c50f9afcfabb744098cfbe409396 100644
--- a/toolkit/themes/shared/pictureinpicture/player.css
+++ b/toolkit/themes/shared/pictureinpicture/player.css
@@ -724,3 +724,17 @@ input:checked + .slider::before {
justify-self: center;
}
}
+
+#minimize {
+ background-image: url("chrome://browser/skin/zen-icons/unpin.svg");
+ background-color: rgba(255, 255, 255, .8);
+ position: absolute;
+ fill: var(--close-btn-fill-color);
+ right: 50px;
+ top: 10px;
+}
+
+#minimize[mac="true"] {
+ right: auto;
+ left: 50px;
+}

View File

@@ -5,8 +5,8 @@
"binaryName": "zen",
"version": {
"product": "firefox",
"version": "136.0.4",
"candidate": "136.0.4"
"version": "136.0.1",
"candidate": "136.0.1"
},
"buildOptions": {
"generateBranding": true
@@ -19,7 +19,7 @@
"brandShortName": "Zen",
"brandFullName": "Zen Browser",
"release": {
"displayVersion": "1.10.3b",
"displayVersion": "1.10b",
"github": {
"repo": "zen-browser/desktop"
},
@@ -39,7 +39,7 @@
"brandShortName": "Twilight",
"brandFullName": "Zen Twilight",
"release": {
"displayVersion": "1.10.3t",
"displayVersion": "1.10t",
"github": {
"repo": "zen-browser/desktop"
}