Merge branch 'main' into shortcuts-redo

This commit is contained in:
mauro 🤙
2024-09-22 22:22:53 +02:00
committed by GitHub
30 changed files with 298 additions and 496 deletions

2
l10n

Submodule l10n updated: 5185d8badc...49b3961b5f

View File

@@ -33,7 +33,7 @@
},
"homepage": "https://github.com/zen-browser/core#readme",
"dependencies": {
"@zen-browser/surfer": "^1.4.20"
"@zen-browser/surfer": "^1.4.21"
},
"devDependencies": {
"husky": "^9.1.5",

10
pnpm-lock.yaml generated
View File

@@ -9,8 +9,8 @@ importers:
.:
dependencies:
'@zen-browser/surfer':
specifier: ^1.4.20
version: 1.4.20
specifier: ^1.4.21
version: 1.4.21
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.20':
resolution: {integrity: sha512-M9+Jax/B+UQsebJ0K3BaNEKUi/EelKufvG2frWQ4uVAQF9LzFwyyliS5wbcUTs3Ufit4b8xQK7ddt02DmK/Lng==}
'@zen-browser/surfer@1.4.21':
resolution: {integrity: sha512-v05Mq6kjISGwWD7d6Bwl0zuH3JKu+xV5x/iJmMjgW3kReYwlKjexqkxQquKpn8bhwAbOBS/CtYBlRKi17Pqxpg==}
hasBin: true
ansi-escapes@7.0.0:
@@ -1003,7 +1003,7 @@ snapshots:
'@types/node@17.0.45': {}
'@zen-browser/surfer@1.4.20':
'@zen-browser/surfer@1.4.21':
dependencies:
'@resvg/resvg-js': 1.4.0
async-icns: 1.0.2

View File

@@ -74,7 +74,7 @@ pref('zen.tabs.vertical', true);
pref('zen.tabs.vertical.right-side', false);
pref('zen.theme.accent-color', "#aac7ff");
pref('zen.theme.border-radius', 5); // In pixels
pref('zen.theme.content-element-separation', 8); // In pixels
pref('zen.theme.content-element-separation', 6); // In pixels
pref('zen.theme.toolbar-themed', true);
pref('zen.theme.pill-button', false);
pref('zen.view.compact', false);

View File

@@ -0,0 +1,127 @@
export var ZenCustomizableUI = new class {
constructor() {}
TYPE_TOOLBAR = 'toolbar';
defaultSidebarIcons = [
'zen-sidepanel-button',
'zen-workspaces-button',
'new-tab-button'
];
startup(CustomizableUIInternal) {
CustomizableUIInternal.registerArea(
"zen-sidebar-top-buttons",
{
type: this.TYPE_TOOLBAR,
defaultPlacements: [
"PanelUI-menu-button", "zen-expand-sidebar-button", "zen-profile-button"
],
defaultCollapsed: null,
}
);
CustomizableUIInternal.registerArea(
"zen-sidebar-icons-wrapper",
{
type: this.TYPE_TOOLBAR,
defaultPlacements: this.defaultSidebarIcons,
defaultCollapsed: null,
}
);
}
// We do not have access to the window object here
init(window) {
this._addSidebarButtons(window);
this._hideToolbarButtons(window);
}
_addSidebarButtons(window) {
const sidebarBox = window.MozXULElement.parseXULToFragment(`
<toolbar id="zen-sidebar-top-buttons"
fullscreentoolbar="true"
class="browser-toolbar customization-target zen-dont-hide-on-fullscreen"
brighttext="true"
data-l10n-id="tabs-toolbar"
customizable="true"
toolbarname="Zen Sidebar Top Buttons"
context="toolbar-context-menu"
flex="1"
customizationtarget="zen-sidebar-top-buttons-customization-target"
mode="icons">
<hbox id="zen-sidebar-top-buttons-customization-target" class="customization-target" flex="1">
<toolbarbutton removable="true" class="chromeclass-toolbar-additional toolbarbutton-1 zen-sidebar-action-button" id="zen-expand-sidebar-button" data-l10n-id="sidebar-zen-expand" cui-areatype="toolbar" oncommand="gZenVerticalTabsManager.toggleExpand();"></toolbarbutton>
<toolbarbutton id="zen-profile-button"
class="zen-sidebar-action-button toolbarbutton-1 chromeclass-toolbar-additional"
delegatesanchor="true"
onmousedown="ZenProfileDialogUI.showSubView(this, event)"
onkeypress="ZenProfileDialogUI.showSubView(this, event)"
consumeanchor="zen-profile-button"
closemenu="none"
data-l10n-id="toolbar-button-account"
cui-areatype="toolbar"
badged="true"
removable="true">
<vbox>
<image id="zen-profile-button-icon" />
</vbox>
</toolbarbutton>
</hbox>
</toolbar>
`);
window.document.getElementById('navigator-toolbox').prepend(sidebarBox);
const sideBarTopButtons = window.document.getElementById('zen-sidebar-top-buttons')
.querySelector('#zen-sidebar-top-buttons-customization-target');
const newTab = window.document.getElementById('vertical-tabs-newtab-button');
newTab.classList.add('zen-sidebar-action-button');
window.CustomizableUI.registerToolbarNode(
window.document.getElementById('zen-sidebar-top-buttons')
);
const panelMenu = window.document.getElementById('PanelUI-menu-button');
panelMenu.classList.add('zen-sidebar-action-button');
panelMenu.setAttribute('cui-areatype', 'toolbar');
sideBarTopButtons.prepend(panelMenu);
for (let id of this.defaultSidebarIcons) {
const elem = window.document.getElementById(id);
if (id === 'zen-workspaces-button' || !elem) continue;
elem.setAttribute('removable', 'true');
}
window.CustomizableUI.registerToolbarNode(
window.document.getElementById('zen-sidebar-icons-wrapper')
);
this._moveWindowButtons(window);
}
_moveWindowButtons(window) {
const windowControls = window.document.getElementsByClassName('titlebar-buttonbox-container');
const toolboxIcons = window.document.getElementById('zen-sidebar-top-buttons-customization-target');
if (window.AppConstants.platform === "macosx") {
for (let i = 0; i < windowControls.length; i++) {
if (i === 0) {
toolboxIcons.prepend(windowControls[i]);
continue;
}
windowControls[i].remove();
}
}
}
_hideToolbarButtons(window) {
const elementsToHide = [
'alltabs-button',
];
for (let id of elementsToHide) {
const elem = window.document.getElementById(id);
if (elem) {
elem.setAttribute('hidden', 'true');
}
}
}
};

View File

@@ -3,6 +3,7 @@
XPCOMUtils.defineLazyPreferenceGetter(lazy, 'sidebarHeightThrottle', 'zen.view.sidebar-height-throttle', 500);
var ZenStartup = {
init() {
this.logHeader();
this.openWatermark();
window.SessionStore.promiseInitialized.then(async () => {
this._changeSidebarLocation();
@@ -95,7 +96,6 @@
},
_changeSidebarLocation() {
const legacyLocation = Services.prefs.getBoolPref('zen.themes.tabs.legacy-location', false);
const kElementsToAppend = ['sidebar-splitter', 'sidebar-box'];
const wrapper = document.getElementById('zen-tabbox-wrapper');
const appWrapepr = document.getElementById('zen-sidebar-box-container');
@@ -123,104 +123,26 @@
splitter.setAttribute('resizebefore', 'sibling');
splitter.setAttribute('resizeafter', 'none');
toolbox.insertAdjacentElement('afterend', splitter);
this._addSidebarButtons();
this._hideToolbarButtons();
},
_moveWindowButtons() {
const windowControls = document.getElementsByClassName('titlebar-buttonbox-container');
const toolboxIcons = document.getElementById('zen-sidebar-top-buttons-customization-target');
if (AppConstants.platform === "macosx") {
for (let i = 0; i < windowControls.length; i++) {
if (i === 0) {
toolboxIcons.prepend(windowControls[i]);
continue;
}
windowControls[i].remove();
}
}
},
_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(`
<toolbar id="zen-sidebar-top-buttons"
fullscreentoolbar="true"
class="browser-toolbar customization-target zen-dont-hide-on-fullscreen"
brighttext="true"
data-l10n-id="tabs-toolbar"
customizable="true"
toolbarname="Zen Sidebar Top Buttons"
context="toolbar-context-menu"
flex="1"
customizationtarget="zen-sidebar-top-buttons-customization-target"
mode="icons">
<hbox id="zen-sidebar-top-buttons-customization-target" class="customization-target" flex="1">
<toolbarbutton removable="true" class="chromeclass-toolbar-additional toolbarbutton-1 zen-sidebar-action-button" id="zen-expand-sidebar-button" data-l10n-id="sidebar-zen-expand" cui-areatype="toolbar" oncommand="gZenVerticalTabsManager.toggleExpand();"></toolbarbutton>
<toolbarbutton removable="true" class="chromeclass-toolbar-additional toolbarbutton-1 zen-sidebar-action-button chromeclass-toolbar-additional subviewbutton-nav" badge="true" closemenu="none" delegatesanchor="true" cui-areatype="toolbar" id="zen-profile-button" data-l10n-id="toolbar-button-account" onclick="ZenProfileDialogUI.showSubView(this, event)"></toolbarbutton>
</hbox>
</toolbar>
`);
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() {
gURLBar.focus();
},
logHeader() {
console.info(`
Welcome to Zen Browser!
If you are seeing this message, it means that you have successfully opened Zen's developer console.
Here you can see all the logs and errors that Zen is generating.
If you have any questions or need help, please contact us in any media in https://zen-browser.app/
Note: This developer console is not the same as the browser console, it has access to Zen's internal functions and variables, including your passwords and other sensitive information. Please do not paste any code here unless you know what you are doing.
`);
}
};
ZenStartup.init();

View File

@@ -1,8 +1,16 @@
diff --git a/browser/base/content/browser-init.js b/browser/base/content/browser-init.js
index f8d49ac2a3a62f389ea44b07a26fcb102abc0b24..c29415e10c776ebc435f33e55f8afb71f0dcf22a 100644
index bee5309c04775adff8652bfe6c54b2d466e821ac..e9741628dcc9eda3500f69441bae293548179e71 100644
--- a/browser/base/content/browser-init.js
+++ b/browser/base/content/browser-init.js
@@ -237,6 +237,10 @@ var gBrowserInit = {
@@ -143,6 +143,7 @@ var gBrowserInit = {
gNavToolbox.palette = document.getElementById(
"BrowserToolbarPalette"
).content;
+ ZenCustomizableUI.init(window);
for (let area of CustomizableUI.areas) {
let type = CustomizableUI.getAreaType(area);
if (type == CustomizableUI.TYPE_TOOLBAR) {
@@ -239,6 +240,10 @@ var gBrowserInit = {
gPrivateBrowsingUI.init();
BrowserSearch.init();
BrowserPageActions.init();

View File

@@ -1,8 +1,16 @@
diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js
index b18f371a47fec53882c3dfb68e34d1a474eaf446..2c183d7e7fc65e00403f5e40e7859b915a3ea700 100644
index a29d7a84e84651ea0bdc9be8e4ac650bde2e048a..e1d1cf3bb925b8efb1411d1dc77a56f086858b5a 100644
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -630,6 +630,15 @@ XPCOMUtils.defineLazyPreferenceGetter(
@@ -32,6 +32,7 @@ ChromeUtils.defineESModuleGetters(this, {
ContextualIdentityService:
"resource://gre/modules/ContextualIdentityService.sys.mjs",
CustomizableUI: "resource:///modules/CustomizableUI.sys.mjs",
+ ZenCustomizableUI: "chrome://browser/content/ZenCustomizableUI.sys.mjs",
DevToolsSocketStatus:
"resource://devtools/shared/security/DevToolsSocketStatus.sys.mjs",
DownloadUtils: "resource://gre/modules/DownloadUtils.sys.mjs",
@@ -629,6 +630,15 @@ XPCOMUtils.defineLazyPreferenceGetter(
false
);
@@ -18,7 +26,7 @@ index b18f371a47fec53882c3dfb68e34d1a474eaf446..2c183d7e7fc65e00403f5e40e7859b91
customElements.setElementCreationCallback("screenshots-buttons", () => {
Services.scriptloader.loadSubScript(
"chrome://browser/content/screenshots/screenshots-buttons.js",
@@ -3679,6 +3688,9 @@ var XULBrowserWindow = {
@@ -3435,6 +3445,9 @@ var XULBrowserWindow = {
AboutReaderParent.updateReaderButton(gBrowser.selectedBrowser);
TranslationsParent.onLocationChange(gBrowser.selectedBrowser);
@@ -28,7 +36,7 @@ index b18f371a47fec53882c3dfb68e34d1a474eaf446..2c183d7e7fc65e00403f5e40e7859b91
PictureInPicture.updateUrlbarToggle(gBrowser.selectedBrowser);
if (!gMultiProcessBrowser) {
@@ -5001,7 +5013,7 @@ function setToolbarVisibility(
@@ -4769,7 +4782,7 @@ function setToolbarVisibility(
);
}
@@ -37,7 +45,7 @@ index b18f371a47fec53882c3dfb68e34d1a474eaf446..2c183d7e7fc65e00403f5e40e7859b91
switch (isVisible) {
case true:
case "always":
@@ -7832,6 +7844,12 @@ var gDialogBox = {
@@ -7609,6 +7622,12 @@ var gDialogBox = {
parentElement.showModal();
this._didOpenHTMLDialog = true;

View File

@@ -3,6 +3,7 @@
content/browser/zenThemeModifier.js (content/zenThemeModifier.js)
content/browser/ZenStartup.mjs (content/ZenStartup.mjs)
content/browser/ZenUIManager.mjs (content/ZenUIManager.mjs)
content/browser/ZenCustomizableUI.sys.mjs (content/ZenCustomizableUI.sys.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)

View File

@@ -5,6 +5,8 @@
transform: translate3d(0, 0, 0);
position: relative;
overflow: hidden;
--uc-tweak-rounded-corners-shadow-color: var(--zen-colors-border);
--uc-tweak-rounded-corners-shadow:

View File

@@ -20,11 +20,11 @@
/* Set the extra paddings */
#tabbrowser-tabpanels {
#browser:has(#navigator-toolbox[zen-right-side='true']) & {
padding-right: var(--zen-element-separation);
padding-right: var(--zen-element-separation) !important;
}
#browser:has(#navigator-toolbox:not([zen-right-side='true'])) & {
padding-left: var(--zen-element-separation);
padding-left: var(--zen-element-separation) !important;
}
}

View File

@@ -4,35 +4,24 @@ toolbar {
}
#zen-profile-button {
display: flex;
justify-content: center;
position: relative;
align-items: center;
list-style-image: var(--avatar-image-url);
position: relative;
border-radius: var(--tab-border-radius);
width: calc(2 * var(--toolbarbutton-inner-padding) + 16px) !important;
height: calc(2 * var(--toolbarbutton-inner-padding) + 16px) !important;
& image {
border-radius: 999px;
display: flex;
justify-content: center;
align-items: center;
height: calc(var(--toolbarbutton-inner-padding) + 10px);
width: calc(var(--toolbarbutton-inner-padding) + 10px);
& stack {
padding: 0;
margin: 0 var(--toolbarbutton-inner-padding) !important;
}
&:hover {
background-color: var(--toolbarbutton-hover-background);
& .toolbarbutton-badge {
display: none !important;
}
& image {
background: transparent !important;
}
& #zen-profile-button-icon {
width: 16px;
height: 16px;
list-style-image: var(--avatar-image-url);
border-radius: 50%;
pointer-events: none;
list-style-image: var(--avatar-image-url);
-moz-context-properties: fill;
fill: currentColor;
}
}

View File

@@ -29,6 +29,7 @@
--tab-hover-background-color: var(--toolbarbutton-hover-background) !important;
min-width: var(--zen-toolbox-min-width);
margin-top: 0 !important; /* Fix full screen mode */
padding: var(--zen-toolbox-padding);
padding-top: var(--zen-toolbox-top-align);
@@ -92,6 +93,12 @@
& .tab-background {
overflow: hidden;
&:is([selected], [multiselected]) {
@media not (prefers-color-scheme: dark) {
border: 1px solid color-mix(in srgb, var(--zen-colors-primary) 60%, transparent 40%) !important;
}
}
& .tab-context-line {
margin: 0 0px !important;
width: 3px !important;
@@ -257,17 +264,6 @@
}
}
}
@media (-moz-bool-pref: 'zen.view.sidebar-expanded.on-hover') {
& #zen-profile-button {
width: 100% !important;
padding: var(--toolbarbutton-inner-padding) !important;
& label {
padding-left: calc(var(--toolbarbutton-inner-padding) * 1.5);
}
}
}
}
/* Mark: toolbox as collapsed */
@@ -303,10 +299,21 @@
display: none !important;
}
&:has(#newtab-button-container tab:not([hidden])) #vertical-pinned-tabs-container {
padding-bottom: 5px !important;
margin-bottom: 5px !important;
border-bottom: 1px solid var(--zen-colors-border) !important;
& #vertical-pinned-tabs-container:has(tab:not([hidden])) {
margin-bottom: 8px;
position: relative;
&::after {
bottom: -4px;
content: '';
display: block;
height: 1px;
background: color-mix(in srgb, var(--zen-colors-border) 80%, transparent 20%);
width: 70%;
left: 50%;
transform: translateX(-50%);
position: absolute;
}
}
& #zen-workspaces-button[as-button='true']::after {
@@ -350,6 +357,12 @@
width: var(--tab-min-width) !important;
height: var(--tab-min-width) !important;
& .tab-background:is([selected], [multiselected]) {
@media not (prefers-color-scheme: dark) {
box-shadow: 0 0 1px 1px rgba(0,0,0,.05) !important;
}
}
& .tab-content {
display: flex;
align-content: center;

View File

@@ -276,9 +276,10 @@ button.popup-notification-dropmarker {
}
}
.titlebar-button:last-child {
/* TODO: Fix this for windows and macos */
/*.titlebar-button:last-child {
padding-right: var(--zen-element-separation) !important;
}
}*/
#PersonalToolbar:not([collapsed="true"]) {
padding-bottom: 6px;

View File

@@ -1,8 +1,16 @@
diff --git a/browser/components/customizableui/CustomizableUI.sys.mjs b/browser/components/customizableui/CustomizableUI.sys.mjs
index 289c3df7dcd6fa6b35681ce61c1e920b6a2651d7..07ecece92643203d376378818facfc55774c63e9 100644
index 289c3df7dcd6fa6b35681ce61c1e920b6a2651d7..aa7d86770cce41a720e92f63392a763b16381f55 100644
--- a/browser/components/customizableui/CustomizableUI.sys.mjs
+++ b/browser/components/customizableui/CustomizableUI.sys.mjs
@@ -25,7 +25,7 @@ ChromeUtils.defineLazyGetter(lazy, "gWidgetsBundle", function () {
@@ -13,6 +13,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
AddonManagerPrivate: "resource://gre/modules/AddonManager.sys.mjs",
BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.sys.mjs",
CustomizableWidgets: "resource:///modules/CustomizableWidgets.sys.mjs",
+ ZenCustomizableUI: "chrome://browser/content/ZenCustomizableUI.sys.mjs",
HomePage: "resource:///modules/HomePage.sys.mjs",
PanelMultiView: "resource:///modules/PanelMultiView.sys.mjs",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
@@ -25,7 +26,7 @@ ChromeUtils.defineLazyGetter(lazy, "gWidgetsBundle", function () {
return Services.strings.createBundle(kUrl);
});
@@ -11,7 +19,16 @@ index 289c3df7dcd6fa6b35681ce61c1e920b6a2651d7..07ecece92643203d376378818facfc55
const kSpecialWidgetPfx = "customizableui-special-";
@@ -253,10 +253,9 @@ var CustomizableUIInternal = {
@@ -222,6 +223,8 @@ var CustomizableUIInternal = {
this._updateForNewProtonVersion();
this._markObsoleteBuiltinButtonsSeen();
+ lazy.ZenCustomizableUI.startup(this);
+
this.registerArea(
CustomizableUI.AREA_FIXED_OVERFLOW_PANEL,
{
@@ -253,10 +256,9 @@ var CustomizableUIInternal = {
"spring",
"urlbar-container",
"spring",
@@ -23,7 +40,7 @@ index 289c3df7dcd6fa6b35681ce61c1e920b6a2651d7..07ecece92643203d376378818facfc55
lazy.resetPBMToolbarButtonEnabled ? "reset-pbm-toolbar-button" : null,
].filter(name => name);
@@ -288,10 +287,10 @@ var CustomizableUIInternal = {
@@ -288,10 +290,10 @@ var CustomizableUIInternal = {
{
type: CustomizableUI.TYPE_TOOLBAR,
defaultPlacements: [
@@ -37,7 +54,7 @@ index 289c3df7dcd6fa6b35681ce61c1e920b6a2651d7..07ecece92643203d376378818facfc55
],
defaultCollapsed: null,
},
@@ -331,6 +330,7 @@ var CustomizableUIInternal = {
@@ -331,6 +333,7 @@ var CustomizableUIInternal = {
CustomizableUI.AREA_NAVBAR,
CustomizableUI.AREA_BOOKMARKS,
CustomizableUI.AREA_TABSTRIP,
@@ -45,3 +62,13 @@ index 289c3df7dcd6fa6b35681ce61c1e920b6a2651d7..07ecece92643203d376378818facfc55
]);
if (AppConstants.platform != "macosx") {
toolbars.add(CustomizableUI.AREA_MENUBAR);
@@ -3289,6 +3292,9 @@ var CustomizableUIInternal = {
gSeenWidgets.add(widgetId);
}
}
+
+
+
if (gSeenWidgets.size || gNewElementCount) {
gDirty = true;
this.saveState();

View File

@@ -34,7 +34,7 @@ var gZenNewWebPanel = {
handleDialogAccept: async function (aEvent) {
document.commandDispatcher.focusedElement?.blur();
let url = document.getElementById('zenNWP_url');
let ua = document.getElementById('zenNWP_userAgent');
let ua = document.getElementById('zenNWP_userAgent'); // checbkox
if (!url || !ua) {
return;
}
@@ -44,12 +44,12 @@ var gZenNewWebPanel = {
} catch (_) {
urlValue = this.addHttpIfMissing(url.value);
}
if (!url.value || !ua.value) {
if (!url.value) {
return;
}
let newSite = {
url: urlValue,
ua: ua.value,
ua: ua.checked,
};
let currentData = JSON.parse(Services.prefs.getStringPref('zen.sidebar.data'));
let newName = 'p' + new Date().getTime();

View File

@@ -499,22 +499,26 @@ var gZenLooksAndFeel = {
setCompactModeStyle() {
const chooser = document.getElementById('zen-compact-mode-styles-form');
const radios = [...chooser.querySelectorAll('input')];
for (let radio of radios) {
if (radio.value === 'left' && Services.prefs.getBoolPref('zen.view.compact.hide-tabbar')) {
radio.checked = true;
} else if (radio.value === 'top' && Services.prefs.getBoolPref('zen.view.compact.hide-toolbar')) {
radio.checked = true;
} else if (
radio.value === 'both' &&
!Services.prefs.getBoolPref('zen.view.compact.hide-tabbar') &&
!Services.prefs.getBoolPref('zen.view.compact.hide-toolbar')
) {
radio.checked = true;
let value = '';
if (Services.prefs.getBoolPref('zen.view.compact.hide-tabbar')
&& Services.prefs.getBoolPref('zen.view.compact.hide-toolbar')) {
value = 'both';
} else {
value = Services.prefs.getBoolPref('zen.view.compact.hide-tabbar') ? 'left' : 'top';
}
chooser.querySelector(`[value='${value}']`).checked = true;
const disableExpandTabsOnHover = () => {
if (Services.prefs.getBoolPref('zen.view.sidebar-expanded.on-hover')) {
document.querySelector(`#zen-expand-tabbar-strat input[value='expand']`).click();
}
}
for (let radio of radios) {
radio.addEventListener('change', (e) => {
let value = e.target.value;
switch (value) {
case 'left':
disableExpandTabsOnHover();
Services.prefs.setBoolPref('zen.view.compact.hide-tabbar', true);
Services.prefs.setBoolPref('zen.view.compact.hide-toolbar', false);
break;
@@ -523,6 +527,7 @@ var gZenLooksAndFeel = {
Services.prefs.setBoolPref('zen.view.compact.hide-toolbar', true);
break;
default:
disableExpandTabsOnHover();
Services.prefs.setBoolPref('zen.view.compact.hide-tabbar', true);
Services.prefs.setBoolPref('zen.view.compact.hide-toolbar', true);
break;
@@ -543,6 +548,14 @@ var gZenLooksAndFeel = {
} else {
form.querySelector('input[value="none"]').checked = true;
}
const disableCompactTabbar = () => {
const toolbarEnable = Services.prefs.getBoolPref('zen.view.compact.hide-toolbar');
if (toolbarEnable) {
document.querySelector(`#ZenCompactModeStyle input[value='top']`).click();
} else if (Services.prefs.getBoolPref('zen.view.compact')) {
document.getElementById('zenLooksAndFeelShowCompactView').click();
}
}
for (let radio of radios) {
radio.addEventListener('change', (e) => {
switch (e.target.value) {
@@ -555,6 +568,7 @@ var gZenLooksAndFeel = {
Services.prefs.setBoolPref(defaultExpandPref, false);
break;
case 'hover':
disableCompactTabbar();
Services.prefs.setBoolPref(onHoverPref, true);
Services.prefs.setBoolPref(defaultExpandPref, true);
break;
@@ -700,7 +714,7 @@ var gZenCKSSettings = {
}
},
_resetShortcut(input) {
async _resetShortcut(input) {
input.value = 'Not set';
input.classList.remove(`${ZEN_CKS_INPUT_FIELD_CLASS}-invalid`);
input.classList.remove(`${ZEN_CKS_INPUT_FIELD_CLASS}-editing`);
@@ -708,7 +722,7 @@ var gZenCKSSettings = {
if (this._currentAction) {
this._editDone();
gZenKeyboardShortcutsManager.setShortcut(this._currentAction, null, null);
await gZenKeyboardShortcutsManager.setShortcut(this._currentAction, null, null);
}
},
@@ -718,7 +732,7 @@ var gZenCKSSettings = {
},
//TODO Check for duplicates
_handleKeyDown(event) {
async _handleKeyDown(event) {
event.preventDefault();
if (!this._currentAction) {

View File

@@ -1,8 +1,8 @@
diff --git a/browser/themes/BuiltInThemeConfig.sys.mjs b/browser/themes/BuiltInThemeConfig.sys.mjs
index 7cfea4b705a1338b1eb5c4f255808aeac4bdb819..9a2d2e096db483f5b93fd39886bee5dda38ce9c4 100644
index 7cfea4b705a1338b1eb5c4f255808aeac4bdb819..cf7dc720a3bd2b14535d57262ad2297f9478eddc 100644
--- a/browser/themes/BuiltInThemeConfig.sys.mjs
+++ b/browser/themes/BuiltInThemeConfig.sys.mjs
@@ -22,22 +22,29 @@ export const BuiltInThemeConfig = new Map([
@@ -22,24 +22,17 @@ export const BuiltInThemeConfig = new Map([
[
"firefox-compact-light@mozilla.org",
{
@@ -19,21 +19,13 @@ index 7cfea4b705a1338b1eb5c4f255808aeac4bdb819..9a2d2e096db483f5b93fd39886bee5dd
path: "resource://builtin-themes/dark/",
},
],
[
- [
- "firefox-alpenglow@mozilla.org",
+ "firefox-compact-galaxy@mozilla.org",
{
- {
- version: "1.4",
- path: "resource://builtin-themes/alpenglow/",
+ version: "1.3",
+ path: "resource://builtin-themes/galaxy/",
+ },
+ ],
+ [
+ "firefox-compact-dream@mozilla.org",
+ {
+ version: "1.3",
+ path: "resource://builtin-themes/dream/",
},
],
- },
- ],
[
"2022red-colorway@mozilla.org",
{

View File

@@ -1,6 +0,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/. */
/* Proton Light theme */
@import url('chrome://browser/skin/light-dark-overrides.css');

View File

@@ -1,12 +0,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/. -->
<svg width="63" height="62" viewBox="0 0 63 62" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="31.5" cy="31" r="31" fill="url(#paint0_linear)"/>
<defs>
<linearGradient id="paint0_linear" x1="11.4829" y1="51" x2="43.4829" y2="19" gradientUnits="userSpaceOnUse">
<stop stop-color="#F0F0F4"/>
<stop offset="1" stop-color="#F9F9FB"/>
</linearGradient>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 614 B

View File

@@ -1,101 +0,0 @@
{
"manifest_version": 2,
"browser_specific_settings": {
"gecko": {
"id": "firefox-compact-dream@mozilla.org"
}
},
"name": "Zen Dream",
"description": "A theme with a light color scheme and a dream-y vibe.",
"author": "Zen",
"version": "1.3",
"icons": { "32": "icon.svg" },
"theme": {
"colors": {
"tab_background_text": "rgb(21,20,26)",
"tab_selected": "#fff",
"tab_text": "rgb(21,20,26)",
"icons": "rgb(91,91,102)",
"frame": "rgb(240, 240, 244)",
"frame_inactive": "rgb(235, 235, 239)",
"popup": "#fff",
"popup_text": "rgb(21,20,26)",
"popup_border": "rgb(240,240,244)",
"popup_highlight": "#e0e0e6",
"popup_highlight_text": "#15141a",
"tab_line": "transparent",
"toolbar": "#f9f9fb",
"toolbar_top_separator": "transparent",
"toolbar_bottom_separator": "#ccc",
"toolbar_field": "rgb(240, 240, 244)",
"toolbar_field_text": "rgb(21, 20, 26)",
"toolbar_field_border": "transparent",
"toolbar_field_focus": "white",
"toolbar_text": "rgb(21,20,26)",
"ntp_background": "#F9F9FB",
"ntp_text": "rgb(21, 20, 26)",
"popup_action_color": "rgb(91,91,102)",
"button": "rgba(207,207,216,.33)",
"button_hover": "rgba(207,207,216,.66)",
"button_active": "rgb(207,207,216)",
"button_primary": "#000",
"button_primary_hover": "rgb(31, 31, 31)",
"button_primary_active": "rgb(207,207,216)",
"button_primary_color": "#fff",
"input_color": "rgb(21,20,26)",
"input_background": "#f0f0f4",
"urlbar_popup_hover": "rgb(240,240,244)",
"urlbar_popup_separator": "rgb(240,240,244)",
"appmenu_update_icon_color": "#2AC3A2",
"appmenu_info_icon_color": "#0090ED",
"tab_icon_overlay_stroke": "rgb(255,255,255)",
"tab_icon_overlay_fill": "rgb(91,91,102)"
},
"properties": {
"color_scheme": "light",
"panel_hover": "color-mix(in srgb, currentColor 12%, transparent)",
"panel_active": "color-mix(in srgb, currentColor 20%, transparent)",
"panel_active_darker": "color-mix(in srgb, currentColor 27%, transparent)",
"toolbar_field_icon_opacity": "0.72",
"input_border_color": "rgba(0, 0, 0, .3)",
"zap_gradient": "linear-gradient(90deg, #9059FF 0%, #FF4AA2 52.08%, #FFBD4F 100%)",
"zen_main_browser_background": "radial-gradient(ellipse, var(--zen-browser-gradient-base, #1B1E27) 20%, rgb(255, 255, 255) 100%)"
}
},
"theme_experiment": {
"stylesheet": "experiment.css",
"colors": {
"popup_action_color": "--urlbarView-action-color",
"button": "--button-bgcolor",
"button_hover": "--button-hover-bgcolor",
"button_active": "--button-active-bgcolor",
"button_primary": "--button-primary-bgcolor",
"button_primary_hover": "--button-primary-hover-bgcolor",
"button_primary_active": "--button-primary-active-bgcolor",
"button_primary_color": "--button-primary-color",
"input_background": "--input-bgcolor",
"input_color": "--input-color",
"input_border": "--input-border-color",
"urlbar_popup_hover": "--urlbarView-hover-background",
"urlbar_popup_separator": "--urlbarView-separator-color",
"appmenu_update_icon_color": "--panel-banner-item-update-supported-bgcolor",
"appmenu_info_icon_color": "--panel-banner-item-info-icon-bgcolor",
"tab_icon_overlay_stroke": "--tab-icon-overlay-stroke",
"tab_icon_overlay_fill": "--tab-icon-overlay-fill"
},
"properties": {
"panel_hover": "--panel-item-hover-bgcolor",
"panel_active": "--arrowpanel-dimmed-further",
"panel_active_darker": "--panel-item-active-bgcolor",
"toolbar_field_icon_opacity": "--urlbar-icon-fill-opacity",
"input_border_color": "--input-border-color",
"zap_gradient": "--panel-separator-zap-gradient",
"zen_main_browser_background": "--zen-main-browser-background"
}
}
}

View File

@@ -1,36 +0,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/. -->
<svg width="680" height="92" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="680" height="92" fill="#F0F0F4" />
<g filter="url(#filter0_dd)">
<rect x="28" y="5" width="166" height="34" rx="4" fill="white" />
</g>
<rect x="51" y="20" width="121" height="4" rx="2" fill="#15141A" />
<rect x="221" y="20" width="121" height="4" rx="2" fill="#15141A" />
<rect y="44" width="680" height="48" fill="#F9F9FB" />
<circle cx="24" cy="68" r="6.25" stroke="#5B5B66" stroke-width="1.5" />
<circle cx="60" cy="68" r="6.25" stroke="#5B5B66" stroke-width="1.5" />
<line x1="663" y1="73.75" x2="649" y2="73.75" stroke="#5B5B66" stroke-width="1.5" />
<line x1="663" y1="67.75" x2="649" y2="67.75" stroke="#5B5B66" stroke-width="1.5" />
<line x1="663" y1="61.75" x2="649" y2="61.75" stroke="#5B5B66" stroke-width="1.5" />
<rect x="114" y="52" width="488" height="32" rx="4" fill="#F0F0F4" />
<circle cx="130" cy="68" r="6.25" stroke="#5B5B66" stroke-width="1.5" />
<rect x="146" y="66" width="308" height="4" rx="2" fill="#5B5B66" />
<defs>
<filter id="filter0_dd" x="24" y="1" width="174" height="42" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix" />
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" />
<feOffset />
<feGaussianBlur stdDeviation="2" />
<feColorMatrix type="matrix" values="0 0 0 0 0.501961 0 0 0 0 0.501961 0 0 0 0 0.556863 0 0 0 0.5 0" />
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow" />
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" />
<feOffset />
<feGaussianBlur stdDeviation="0.5" />
<feColorMatrix type="matrix" values="0 0 0 0 0.501961 0 0 0 0 0.501961 0 0 0 0 0.556863 0 0 0 0.9 0" />
<feBlend mode="normal" in2="effect1_dropShadow" result="effect2_dropShadow" />
<feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow" result="shape" />
</filter>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -1,6 +0,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/. */
/* Proton Dark theme */
@import url('chrome://browser/skin/light-dark-overrides.css');

View File

@@ -1,12 +0,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/. -->
<svg width="63" height="62" viewBox="0 0 63 62" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="31.5" cy="31" r="31" fill="url(#paint0_linear)"/>
<defs>
<linearGradient id="paint0_linear" x1="44.4829" y1="19" x2="10.4829" y2="53" gradientUnits="userSpaceOnUse">
<stop stop-color="#42414D"/>
<stop offset="1" stop-color="#1C1B22"/>
</linearGradient>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 614 B

View File

@@ -1,95 +0,0 @@
{
"manifest_version": 2,
"browser_specific_settings": {
"gecko": {
"id": "firefox-compact-galaxy@mozilla.org"
}
},
"name": "Zen Galaxy",
"description": "A theme with a dark color scheme and galaxy effects.",
"author": "Zen",
"version": "1.3",
"icons": { "32": "icon.svg" },
"theme": {
"colors": {
"tab_background_text": "#fbfbfe",
"tab_selected": "rgb(66,65,77)",
"tab_text": "rgb(251,251,254)",
"icons": "rgb(251,251,254)",
"frame": "rgb(28, 27, 34)",
"frame_inactive": "rgb(31, 30, 37)",
"popup": "rgb(66,65,77)",
"popup_text": "rgb(251,251,254)",
"popup_border": "rgb(82,82,94)",
"popup_highlight": "rgb(43,42,51)",
"tab_line": "transparent",
"toolbar": "rgb(43,42,51)",
"toolbar_top_separator": "transparent",
"toolbar_bottom_separator": "hsl(240, 5%, 5%)",
"toolbar_field": "rgb(28,27,34)",
"toolbar_field_border": "transparent",
"toolbar_field_text": "rgb(251,251,254)",
"toolbar_field_focus": "rgb(66,65,77)",
"toolbar_text": "rgb(251, 251, 254)",
"ntp_background": "rgb(43, 42, 51)",
"ntp_card_background": "rgb(66,65,77)",
"ntp_text": "rgb(251, 251, 254)",
"sidebar_text": "rgb(249, 249, 250)",
"sidebar_border": "rgba(255, 255, 255, 0.1)",
"button": "rgba(0, 0, 0, .33)",
"button_hover": "rgba(207, 207, 216, .20)",
"button_active": "rgba(207, 207, 216, .40)",
"button_primary": "#fff",
"button_primary_hover": "rgb(207, 207, 216)",
"button_primary_active": "rgb(207, 207, 216)",
"button_primary_color": "#000",
"input_background": "#42414D",
"input_color": "rgb(251,251,254)",
"input_border": "#fff",
"urlbar_popup_separator": "rgb(82,82,94)",
"appmenu_update_icon_color": "#54FFBD",
"appmenu_info_icon_color": "#80EBFF",
"tab_icon_overlay_stroke": "rgb(66,65,77)",
"tab_icon_overlay_fill": "rgb(251,251,254)"
},
"properties": {
"color_scheme": "dark",
"panel_active": "color-mix(in srgb, currentColor 14%, transparent)",
"toolbar_field_icon_opacity": "1",
"zap_gradient": "linear-gradient(90deg, #9059FF 0%, #FF4AA2 52.08%, #FFBD4F 100%)",
"zen_main_browser_background": "radial-gradient(ellipse, var(--zen-browser-gradient-base, #1B1E27) 20%, #1b1b1b 100%)"
}
},
"theme_experiment": {
"stylesheet": "experiment.css",
"colors": {
"button": "--button-bgcolor",
"button_hover": "--button-hover-bgcolor",
"button_active": "--button-active-bgcolor",
"button_primary": "--button-primary-bgcolor",
"button_primary_hover": "--button-primary-hover-bgcolor",
"button_primary_active": "--button-primary-active-bgcolor",
"button_primary_color": "--button-primary-color",
"input_background": "--input-bgcolor",
"input_color": "--input-color",
"input_border": "--input-border-color",
"urlbar_popup_separator": "--urlbarView-separator-color",
"zoom_controls": "--zoom-controls-bgcolor",
"appmenu_update_icon_color": "--panel-banner-item-update-supported-bgcolor",
"appmenu_info_icon_color": "--panel-banner-item-info-icon-bgcolor",
"tab_icon_overlay_stroke": "--tab-icon-overlay-stroke",
"tab_icon_overlay_fill": "--tab-icon-overlay-fill"
},
"properties": {
"panel_active": "--arrowpanel-dimmed-further",
"toolbar_field_icon_opacity": "--urlbar-icon-fill-opacity",
"zap_gradient": "--panel-separator-zap-gradient",
"zen_main_browser_background": "--zen-main-browser-background"
}
}
}

View File

@@ -1,18 +0,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/. -->
<svg width="680" height="92" viewBox="0 0 680 92" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="680" height="92" fill="#1C1B22" />
<rect x="28" y="5" width="166" height="34" rx="4" fill="#42414D" />
<rect x="51" y="20" width="121" height="4" rx="2" fill="#FBFBFE" />
<rect x="221" y="20" width="121" height="4" rx="2" fill="#B8B7BB" />
<rect y="44" width="680" height="48" fill="#2B2A33" />
<circle cx="24" cy="68" r="6.25" stroke="#FBFBFE" stroke-width="1.5" />
<circle cx="60" cy="68" r="6.25" stroke="#FBFBFE" stroke-width="1.5" />
<line x1="663" y1="73.75" x2="649" y2="73.75" stroke="#FBFBFE" stroke-width="1.5" />
<line x1="663" y1="67.75" x2="649" y2="67.75" stroke="#FBFBFE" stroke-width="1.5" />
<line x1="663" y1="61.75" x2="649" y2="61.75" stroke="#FBFBFE" stroke-width="1.5" />
<rect x="114" y="52" width="488" height="32" rx="4" fill="#1C1B22" />
<circle cx="130" cy="68" r="6.25" stroke="white" stroke-width="1.5" />
<rect x="146" y="66" width="308" height="4" rx="2" fill="white" />
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -1,8 +1 @@
content/builtin-themes/galaxy (galaxy/*.svg)
content/builtin-themes/galaxy (galaxy/*.css)
content/builtin-themes/galaxy/manifest.json (galaxy/manifest.json)
content/builtin-themes/dream (dream/*.svg)
content/builtin-themes/dream (dream/*.css)
content/builtin-themes/dream/manifest.json (dream/manifest.json)

View File

@@ -1,8 +1,8 @@
diff --git a/toolkit/mozapps/extensions/internal/XPIDatabase.sys.mjs b/toolkit/mozapps/extensions/internal/XPIDatabase.sys.mjs
index 0e02963b7e2f44e7669a34ded9f0f0636e36e66c..03e203b4eb0c9436ff9767756bfe8e64dd49096e 100644
index 17219a88b42b0954f7bd7f7ea7ae8dcad55cc77c..e59373c2cac68fb3075e32143bb8940749c20a8a 100644
--- a/toolkit/mozapps/extensions/internal/XPIDatabase.sys.mjs
+++ b/toolkit/mozapps/extensions/internal/XPIDatabase.sys.mjs
@@ -137,7 +137,7 @@ const KEY_APP_GLOBAL = "app-global";
@@ -138,7 +138,7 @@ const KEY_APP_GLOBAL = "app-global";
const KEY_APP_PROFILE = "app-profile";
const KEY_APP_TEMPORARY = "app-temporary";
@@ -11,12 +11,3 @@ index 0e02963b7e2f44e7669a34ded9f0f0636e36e66c..03e203b4eb0c9436ff9767756bfe8e64
// Properties to cache and reload when an addon installation is pending
const PENDING_INSTALL_METADATA = [
@@ -214,7 +214,7 @@ const SIGNED_TYPES = new Set(["extension", "locale", "theme"]);
// Time to wait before async save of XPI JSON database, in milliseconds
const ASYNC_SAVE_DELAY_MS = 20;
-const l10n = new Localization(["browser/appExtensionFields.ftl"], true);
+const l10n = new Localization(["browser/appExtensionFields.ftl", "browser/zenAppExtensionFields.ftl"], true);
/**
* Schedules an idle task, and returns a promise which resolves to an

View File

@@ -18,7 +18,7 @@
"brandShortName": "Zen Browser",
"brandFullName": "Zen Browser",
"release": {
"displayVersion": "1.0.1-a.2",
"displayVersion": "1.0.1-a.3",
"github": {
"repo": "zen-browser/desktop"
},