Made the code look cleaner

This commit is contained in:
mauro-balades
2024-10-04 18:21:41 +02:00
parent 57bf881779
commit e2792eecb5
22 changed files with 183 additions and 187 deletions

View File

@@ -416,8 +416,8 @@ jobs:
zen.installer-generic.exe zen.installer-generic.exe
zen.macos-x64.dmg zen.macos-x64.dmg
zen.macos-aarch64.dmg zen.macos-aarch64.dmg
tag_name: "twilight" tag_name: 'twilight'
name: "Twilight build - ${{ needs.build-data.outputs.version }} (${{ needs.build-data.outputs.build_date }})" name: 'Twilight build - ${{ needs.build-data.outputs.version }} (${{ needs.build-data.outputs.build_date }})'
body: | body: |
# Zen Twilight Build # Zen Twilight Build

View File

@@ -80,6 +80,7 @@ bash <(curl https://updates.zen-browser.app/appimage.sh)
``` ```
#### Flatpak #### Flatpak
``` ```
flatpak install flathub io.github.zen_browser.zen flatpak install flathub io.github.zen_browser.zen
``` ```
@@ -132,6 +133,7 @@ pnpm start
### Development ### Development
To view changes you've made, run To view changes you've made, run
```bash ```bash
pnpm build:ui && pnpm start pnpm build:ui && pnpm start
``` ```

View File

@@ -1,28 +1,21 @@
export var ZenCustomizableUI = new (class {
export var ZenCustomizableUI = new class {
constructor() {} constructor() {}
TYPE_TOOLBAR = 'toolbar'; TYPE_TOOLBAR = 'toolbar';
defaultSidebarIcons = [ defaultSidebarIcons = ['zen-sidepanel-button', 'zen-workspaces-button', 'new-tab-button'];
'zen-sidepanel-button',
'zen-workspaces-button',
'new-tab-button'
];
startup(CustomizableUIInternal) { startup(CustomizableUIInternal) {
CustomizableUIInternal.registerArea( CustomizableUIInternal.registerArea(
"zen-sidebar-top-buttons", 'zen-sidebar-top-buttons',
{ {
type: this.TYPE_TOOLBAR, type: this.TYPE_TOOLBAR,
defaultPlacements: [ defaultPlacements: ['preferences-button', 'zen-expand-sidebar-button', 'zen-profile-button'],
"preferences-button", "zen-expand-sidebar-button", "zen-profile-button"
],
defaultCollapsed: null, defaultCollapsed: null,
}, },
true true
); );
CustomizableUIInternal.registerArea( CustomizableUIInternal.registerArea(
"zen-sidebar-icons-wrapper", 'zen-sidebar-icons-wrapper',
{ {
type: this.TYPE_TOOLBAR, type: this.TYPE_TOOLBAR,
defaultPlacements: this.defaultSidebarIcons, defaultPlacements: this.defaultSidebarIcons,
@@ -92,7 +85,7 @@ export var ZenCustomizableUI = new class {
_moveWindowButtons(window) { _moveWindowButtons(window) {
const windowControls = window.document.getElementsByClassName('titlebar-buttonbox-container'); const windowControls = window.document.getElementsByClassName('titlebar-buttonbox-container');
const toolboxIcons = window.document.getElementById('zen-sidebar-top-buttons-customization-target'); const toolboxIcons = window.document.getElementById('zen-sidebar-top-buttons-customization-target');
if (window.AppConstants.platform === "macosx") { if (window.AppConstants.platform === 'macosx') {
for (let i = 0; i < windowControls.length; i++) { for (let i = 0; i < windowControls.length; i++) {
if (i === 0) { if (i === 0) {
toolboxIcons.prepend(windowControls[i]); toolboxIcons.prepend(windowControls[i]);
@@ -104,9 +97,7 @@ export var ZenCustomizableUI = new class {
} }
_hideToolbarButtons(window) { _hideToolbarButtons(window) {
const elementsToHide = [ const elementsToHide = ['alltabs-button'];
'alltabs-button',
];
for (let id of elementsToHide) { for (let id of elementsToHide) {
const elem = window.document.getElementById(id); const elem = window.document.getElementById(id);
if (elem) { if (elem) {
@@ -116,11 +107,7 @@ export var ZenCustomizableUI = new class {
} }
registerToolbarNodes(window) { registerToolbarNodes(window) {
window.CustomizableUI.registerToolbarNode( window.CustomizableUI.registerToolbarNode(window.document.getElementById('zen-sidebar-top-buttons'));
window.document.getElementById('zen-sidebar-top-buttons') window.CustomizableUI.registerToolbarNode(window.document.getElementById('zen-sidebar-icons-wrapper'));
);
window.CustomizableUI.registerToolbarNode(
window.document.getElementById('zen-sidebar-icons-wrapper')
);
} }
}; })();

View File

@@ -147,7 +147,7 @@
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. 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(); ZenStartup.init();

View File

@@ -1,8 +1,7 @@
var gZenUIManager = { var gZenUIManager = {
_popupTrackingElements: [], _popupTrackingElements: [],
init () { init() {
document.addEventListener('popupshowing', this.onPopupShowing.bind(this)); document.addEventListener('popupshowing', this.onPopupShowing.bind(this));
document.addEventListener('popuphidden', this.onPopupHidden.bind(this)); document.addEventListener('popuphidden', this.onPopupHidden.bind(this));
}, },
@@ -67,7 +66,7 @@ var gZenUIManager = {
element.removeAttribute('has-popup-menu'); element.removeAttribute('has-popup-menu');
} else { } else {
this.__removeHasPopupAttribute = () => element.removeAttribute('has-popup-menu'); this.__removeHasPopupAttribute = () => element.removeAttribute('has-popup-menu');
document.addEventListener('mousemove', this.__removeHasPopupAttribute, {once: true}); document.addEventListener('mousemove', this.__removeHasPopupAttribute, { once: true });
} }
this.__currentPopup = null; this.__currentPopup = null;
this.__currentPopupTrackElement = null; this.__currentPopupTrackElement = null;
@@ -85,23 +84,18 @@ var gZenVerticalTabsManager = {
this._updateEvent(); this._updateEvent();
this.initRightSideOrderContextMenu(); this.initRightSideOrderContextMenu();
let tabs = document.getElementById("tabbrowser-tabs"); let tabs = document.getElementById('tabbrowser-tabs');
XPCOMUtils.defineLazyPreferenceGetter( XPCOMUtils.defineLazyPreferenceGetter(this, 'canOpenTabOnMiddleClick', 'zen.tabs.newtab-on-middle-click', true);
this,
"canOpenTabOnMiddleClick",
"zen.tabs.newtab-on-middle-click",
true
);
if (tabs) { if (tabs) {
tabs.addEventListener("mouseup", this.openNewTabOnTabsMiddleClick.bind(this)); tabs.addEventListener('mouseup', this.openNewTabOnTabsMiddleClick.bind(this));
} }
}, },
openNewTabOnTabsMiddleClick(event) { openNewTabOnTabsMiddleClick(event) {
if (event.button === 1 && event.target.id === "tabbrowser-tabs" && this.canOpenTabOnMiddleClick) { if (event.button === 1 && event.target.id === 'tabbrowser-tabs' && this.canOpenTabOnMiddleClick) {
document.getElementById("cmd_newNavigatorTabNoEvent").doCommand(); document.getElementById('cmd_newNavigatorTabNoEvent').doCommand();
event.stopPropagation(); event.stopPropagation();
event.preventDefault(); event.preventDefault();
} }
@@ -157,8 +151,12 @@ var gZenVerticalTabsManager = {
this.navigatorToolbox.removeAttribute('zen-expanded'); this.navigatorToolbox.removeAttribute('zen-expanded');
} }
if (this.navigatorToolbox.hasAttribute('zen-expanded') && !this.navigatorToolbox.hasAttribute('zen-right-side') if (
&& !Services.prefs.getBoolPref('zen.view.compact') && !Services.prefs.getBoolPref('zen.view.sidebar-expanded.on-hover')) { this.navigatorToolbox.hasAttribute('zen-expanded') &&
!this.navigatorToolbox.hasAttribute('zen-right-side') &&
!Services.prefs.getBoolPref('zen.view.compact') &&
!Services.prefs.getBoolPref('zen.view.sidebar-expanded.on-hover')
) {
this.navigatorToolbox.prepend(topButtons); this.navigatorToolbox.prepend(topButtons);
browser.prepend(this.navigatorToolbox); browser.prepend(this.navigatorToolbox);
} else { } else {

View File

@@ -23,20 +23,15 @@
</linkset> </linkset>
<!-- Scripts used all over the browser --> <!-- Scripts used all over the browser -->
<script type="text/javascript"> <script src="chrome://browser/content/zen-components/ZenCommonUtils.mjs" async="true"/>
window.addEventListener("DOMContentLoaded", async () => { <script src="chrome://browser/content/zen-components/ZenThemesCommon.mjs" />
// Theme importer always needs to be loaded first <script src="chrome://browser/content/zen-components/ZenThemesImporter.mjs" />
await Services.scriptloader.loadSubScript("chrome://browser/content/zen-components/ZenCommonUtils.mjs"); <script src="chrome://browser/content/zen-components/ZenCompactMode.mjs" />
Services.scriptloader.loadSubScript("chrome://browser/content/zen-components/ZenThemesCommon.mjs"); <script src="chrome://browser/content/ZenUIManager.mjs" />
Services.scriptloader.loadSubScript("chrome://browser/content/zen-components/ZenThemesImporter.mjs"); <script src="chrome://browser/content/zen-components/ZenSidebarManager.mjs"/>
Services.scriptloader.loadSubScript("chrome://browser/content/zen-components/ZenCompactMode.mjs"); <script src="chrome://browser/content/zen-components/ZenTabUnloader.mjs" />
Services.scriptloader.loadSubScript("chrome://browser/content/ZenUIManager.mjs"); <script src="chrome://browser/content/zen-components/ZenWorkspaces.mjs" />
Services.scriptloader.loadSubScript("chrome://browser/content/zen-components/ZenSidebarManager.mjs"); <script src="chrome://browser/content/zen-components/ZenWorkspacesStorage.mjs" />
Services.scriptloader.loadSubScript("chrome://browser/content/zen-components/ZenTabUnloader.mjs"); <script src="chrome://browser/content/zen-components/ZenViewSplitter.mjs"/>
Services.scriptloader.loadSubScript("chrome://browser/content/zen-components/ZenWorkspaces.mjs"); <script src="chrome://browser/content/zen-components/ZenProfileDialogUI.mjs" />
Services.scriptloader.loadSubScript("chrome://browser/content/zen-components/ZenWorkspacesStorage.mjs"); <script src="chrome://browser/content/zen-components/ZenKeyboardShortcuts.mjs" />
Services.scriptloader.loadSubScript("chrome://browser/content/zen-components/ZenViewSplitter.mjs");
Services.scriptloader.loadSubScript("chrome://browser/content/zen-components/ZenProfileDialogUI.mjs");
Services.scriptloader.loadSubScript("chrome://browser/content/zen-components/ZenKeyboardShortcuts.mjs");
}, { once: true });
</script>

View File

@@ -7,15 +7,14 @@
--uc-tweak-rounded-corners-shadow-color: var(--zen-colors-border); --uc-tweak-rounded-corners-shadow-color: var(--zen-colors-border);
--uc-tweak-rounded-corners-shadow: --uc-tweak-rounded-corners-shadow: 0 0 0 1px var(--uc-tweak-rounded-corners-shadow-color);
0 0 0 1px var(--uc-tweak-rounded-corners-shadow-color);
box-shadow: var(--uc-tweak-rounded-corners-shadow) !important; box-shadow: var(--uc-tweak-rounded-corners-shadow) !important;
/* Use pseudo element overlay to simulate rounded corners, similar to the /* Use pseudo element overlay to simulate rounded corners, similar to the
* tab corners, fixes bug with backdrop-filter. */ * tab corners, fixes bug with backdrop-filter. */
&::after { &::after {
content: ""; content: '';
position: absolute; position: absolute;
inset: 0; inset: 0;
border-radius: inherit; border-radius: inherit;

View File

@@ -15,7 +15,7 @@
padding-right: var(--zen-element-separation); padding-right: var(--zen-element-separation);
padding-bottom: var(--zen-element-separation); padding-bottom: var(--zen-element-separation);
#browser:has(#navigator-toolbox[zen-right-side="true"]) & { #browser:has(#navigator-toolbox[zen-right-side='true']) & {
padding-right: 0; padding-right: 0;
padding-left: var(--zen-element-separation); padding-left: var(--zen-element-separation);
} }

View File

@@ -38,7 +38,7 @@
height: calc(98% - var(--zen-element-separation)); height: calc(98% - var(--zen-element-separation));
z-index: 9; z-index: 9;
background: var(--zen-themed-toolbar-bg) !important; background: var(--zen-themed-toolbar-bg) !important;
box-shadow: 0 0 2px 2px rgba(0,0,0,.1); box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.1);
border-top-right-radius: var(--zen-border-radius); border-top-right-radius: var(--zen-border-radius);
border-bottom-right-radius: var(--zen-border-radius); border-bottom-right-radius: var(--zen-border-radius);
border: 1px solid var(--zen-colors-border); border: 1px solid var(--zen-colors-border);
@@ -84,7 +84,6 @@
} }
@media (-moz-bool-pref: 'zen.view.compact.hide-toolbar') { @media (-moz-bool-pref: 'zen.view.compact.hide-toolbar') {
#navigator-toolbox { #navigator-toolbox {
--zen-toolbox-top-align: var(--zen-element-separation); --zen-toolbox-top-align: var(--zen-element-separation);
} }
@@ -100,7 +99,7 @@
left: 0; left: 0;
z-index: 10; z-index: 10;
background: var(--zen-themed-toolbar-bg); background: var(--zen-themed-toolbar-bg);
box-shadow: 0 0 2px 2px rgba(0,0,0,.1) !important; box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.1) !important;
border-bottom-left-radius: var(--zen-border-radius); border-bottom-left-radius: var(--zen-border-radius);
border-bottom-right-radius: var(--zen-border-radius); border-bottom-right-radius: var(--zen-border-radius);
border: 1px solid var(--zen-colors-border); border: 1px solid var(--zen-colors-border);
@@ -109,7 +108,7 @@
width: 100%; width: 100%;
opacity: 0; opacity: 0;
:root[tabsintitlebar][sizemode="normal"]:not([gtktiledwindow="true"]) & { :root[tabsintitlebar][sizemode='normal']:not([gtktiledwindow='true']) & {
border-top-left-radius: env(-moz-gtk-csd-titlebar-radius); border-top-left-radius: env(-moz-gtk-csd-titlebar-radius);
border-top-right-radius: env(-moz-gtk-csd-titlebar-radius); border-top-right-radius: env(-moz-gtk-csd-titlebar-radius);
border-left-width: 0; border-left-width: 0;

View File

@@ -1,10 +1,8 @@
toolbar { toolbar {
min-height: 46px; min-height: 46px;
} }
#zen-profile-button { #zen-profile-button {
& stack { & stack {
padding: 0; padding: 0;
} }
@@ -69,7 +67,7 @@ toolbar {
overflow: hidden; overflow: hidden;
border: 1px solid var(--zen-colors-border); border: 1px solid var(--zen-colors-border);
:root:has(#navigator-toolbox:not([zen-right-side='true'])) &[positionend="true"] { :root:has(#navigator-toolbox:not([zen-right-side='true'])) &[positionend='true'] {
margin-right: var(--zen-element-separation); margin-right: var(--zen-element-separation);
} }

View File

@@ -1,5 +1,4 @@
@media (-moz-bool-pref: 'zen.tabs.vertical') { @media (-moz-bool-pref: 'zen.tabs.vertical') {
#tabbrowser-tabs, #tabbrowser-tabs,
#TabsToolbar, #TabsToolbar,
#titlebar, #titlebar,
@@ -10,7 +9,6 @@
#TabsToolbar > * { #TabsToolbar > * {
justify-content: center; justify-content: center;
} }
#private-browsing-indicator-with-label { #private-browsing-indicator-with-label {
@@ -39,8 +37,8 @@
display: flex; display: flex;
} }
.titlebar-spacer[type="pre-tabs"], .titlebar-spacer[type='pre-tabs'],
.titlebar-spacer[type="post-tabs"] { .titlebar-spacer[type='post-tabs'] {
display: none; display: none;
} }
@@ -66,7 +64,8 @@
} }
#vertical-tabs-newtab-button { #vertical-tabs-newtab-button {
&:hover, &:not(:is(:hover, :active)) .toolbarbutton-icon { &:hover,
&:not(:is(:hover, :active)) .toolbarbutton-icon {
background: transparent !important; background: transparent !important;
} }
} }
@@ -158,13 +157,14 @@
/* Mark: toolbox as expanded */ /* Mark: toolbox as expanded */
#navigator-toolbox:is( #navigator-toolbox:is(
#navigator-toolbox[zen-user-hover='true'][zen-has-hover], #navigator-toolbox[zen-user-hover='true'][zen-has-hover],
#navigator-toolbox[zen-user-hover='true']:focus-within, #navigator-toolbox[zen-user-hover='true']:focus-within,
#navigator-toolbox[zen-user-hover='true'][movingtab], #navigator-toolbox[zen-user-hover='true'][movingtab],
#navigator-toolbox[zen-user-hover='true'][flash-popup], #navigator-toolbox[zen-user-hover='true'][flash-popup],
#navigator-toolbox[zen-user-hover='true'][has-popup-menu], #navigator-toolbox[zen-user-hover='true'][has-popup-menu],
#navigator-toolbox[zen-user-hover='true']:has(*[open='true']:not(tab):not(#zen-sidepanel-button)), #navigator-toolbox[zen-user-hover='true']:has(*[open='true']:not(tab):not(#zen-sidepanel-button)),
#navigator-toolbox[zen-expanded='true']:not([zen-user-hover='true'])) { #navigator-toolbox[zen-expanded='true']:not([zen-user-hover='true'])
) {
--zen-toolbox-min-width: fit-content; --zen-toolbox-min-width: fit-content;
padding: var(--zen-toolbox-padding); padding: var(--zen-toolbox-padding);
padding-top: 0; padding-top: 0;
@@ -232,7 +232,8 @@
&:is([open], [checked]) { &:is([open], [checked]) {
background: var(--toolbarbutton-active-background) !important; background: var(--toolbarbutton-active-background) !important;
& image, label { & image,
label {
background: transparent !important; background: transparent !important;
} }
} }
@@ -240,7 +241,8 @@
&:hover { &:hover {
background: var(--toolbarbutton-hover-background) !important; background: var(--toolbarbutton-hover-background) !important;
& image, label { & image,
label {
background: transparent !important; background: transparent !important;
} }
} }
@@ -274,14 +276,17 @@
} }
/* Mark: toolbox as collapsed */ /* Mark: toolbox as collapsed */
#navigator-toolbox:not(#navigator-toolbox:is( #navigator-toolbox:not(
#navigator-toolbox[zen-user-hover='true'][zen-has-hover], #navigator-toolbox:is(
#navigator-toolbox[zen-user-hover='true']:focus-within, #navigator-toolbox[zen-user-hover='true'][zen-has-hover],
#navigator-toolbox[zen-user-hover='true'][movingtab], #navigator-toolbox[zen-user-hover='true']:focus-within,
#navigator-toolbox[zen-user-hover='true'][flash-popup], #navigator-toolbox[zen-user-hover='true'][movingtab],
#navigator-toolbox[zen-user-hover='true'][has-popup-menu], #navigator-toolbox[zen-user-hover='true'][flash-popup],
#navigator-toolbox[zen-user-hover='true']:has(*[open='true']:not(tab):not(#zen-sidepanel-button)), #navigator-toolbox[zen-user-hover='true'][has-popup-menu],
#navigator-toolbox[zen-expanded='true']:not([zen-user-hover='true']))) { #navigator-toolbox[zen-user-hover='true']:has(*[open='true']:not(tab):not(#zen-sidepanel-button)),
#navigator-toolbox[zen-expanded='true']:not([zen-user-hover='true'])
)
) {
/* Important: When changin this value, make sure expand on hover doesn't break! */ /* Important: When changin this value, make sure expand on hover doesn't break! */
--zen-toolbox-max-width: 49px; /* 1px more because the browser view has one pixel of padding to avoid the border being cut off */ --zen-toolbox-max-width: 49px; /* 1px more because the browser view has one pixel of padding to avoid the border being cut off */
--zen-toolbox-padding: 8px; --zen-toolbox-padding: 8px;
@@ -368,7 +373,7 @@
& .tab-background:is([selected], [multiselected]) { & .tab-background:is([selected], [multiselected]) {
@media not (prefers-color-scheme: dark) { @media not (prefers-color-scheme: dark) {
box-shadow: 0 0 1px 1px rgba(0,0,0,.05) !important; box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.05) !important;
} }
} }
@@ -399,17 +404,26 @@
display: none !important; display: none !important;
:is( :is(
:root[uidensity=compact], :root[uidensity='compact'],
#tabbrowser-tabs[secondarytext-unsupported], #tabbrowser-tabs[secondarytext-unsupported],
:root:not([uidensity=compact]) #tabbrowser-tabs:not([secondarytext-unsupported]) .tabbrowser-tab:hover :root:not([uidensity='compact']) #tabbrowser-tabs:not([secondarytext-unsupported]) .tabbrowser-tab:hover
) .tab-icon-stack[indicator-replaces-favicon] > :not(&), )
:root:not([uidensity=compact]) #tabbrowser-tabs:not([secondarytext-unsupported]) .tabbrowser-tab:not(:hover) &[indicator-replaces-favicon] { .tab-icon-stack[indicator-replaces-favicon]
> :not(&),
:root:not([uidensity='compact'])
#tabbrowser-tabs:not([secondarytext-unsupported])
.tabbrowser-tab:not(:hover)
&[indicator-replaces-favicon] {
opacity: 1 !important; opacity: 1 !important;
} }
} }
} }
& .tab-throbber, & .tab-icon-pending, & .tab-icon-image, & .tab-sharing-icon-overlay, & .tab-icon-overlay { & .tab-throbber,
& .tab-icon-pending,
& .tab-icon-image,
& .tab-sharing-icon-overlay,
& .tab-icon-overlay {
margin-inline-end: 0 !important; margin-inline-end: 0 !important;
} }
} }
@@ -418,7 +432,6 @@
flex-direction: column; flex-direction: column;
&:not([as-button='true']) { &:not([as-button='true']) {
& toolbarbutton { & toolbarbutton {
&[active='true']::after { &[active='true']::after {
bottom: 50% !important; bottom: 50% !important;
@@ -501,7 +514,7 @@
/*animation: zen-vtabs-animation 0.3s ease-in-out;*/ /*animation: zen-vtabs-animation 0.3s ease-in-out;*/
-moz-window-dragging: no-drag; -moz-window-dragging: no-drag;
overflow: hidden; overflow: hidden;
transition: width .2s !important; transition: width 0.2s !important;
& .tab-throbber, & .tab-throbber,
& .tab-icon-pending, & .tab-icon-pending,
@@ -510,7 +523,6 @@
& .tab-icon-overlay { & .tab-icon-overlay {
transition: 0.1s !important; transition: 0.1s !important;
} }
} }
/* Make pinned tabs stay in a single line */ /* Make pinned tabs stay in a single line */

View File

@@ -174,7 +174,7 @@
@media not (-moz-bool-pref: 'zen.theme.toolbar-themed') { @media not (-moz-bool-pref: 'zen.theme.toolbar-themed') {
:root { :root {
--toolbar-bgcolor: light-dark(#E6E6E6, #1b1b1b) !important; --toolbar-bgcolor: light-dark(#e6e6e6, #1b1b1b) !important;
--zen-themed-toolbar-bg: var(--toolbar-bgcolor); --zen-themed-toolbar-bg: var(--toolbar-bgcolor);
} }
} }

View File

@@ -207,12 +207,15 @@ button.popup-notification-dropmarker {
} }
/* Border radius on hover */ /* Border radius on hover */
#urlbar .urlbar-page-action, #urlbar #tracking-protection-icon-container, #urlbar:not([breakout-extend="true"]) #identity-box:is(:not(.chromeUI), [pageproxystate="invalid"]) #identity-icon-box { #urlbar .urlbar-page-action,
border-radius: 6px !important;; #urlbar #tracking-protection-icon-container,
#urlbar:not([breakout-extend='true']) #identity-box:is(:not(.chromeUI), [pageproxystate='invalid']) #identity-icon-box {
border-radius: 6px !important;
} }
/* Border radius of boxes on the left */ /* Border radius of boxes on the left */
#identity-box:has(#identity-permission-box:is([hasPermissions], [hasSharingIcon])):not([pageproxystate="invalid"]) #identity-icon-box { #identity-box:has(#identity-permission-box:is([hasPermissions], [hasSharingIcon])):not([pageproxystate='invalid'])
#identity-icon-box {
border-top-left-radius: 6px !important; border-top-left-radius: 6px !important;
border-bottom-left-radius: 6px !important; border-bottom-left-radius: 6px !important;
border-top-right-radius: 0 !important; border-top-right-radius: 0 !important;
@@ -220,17 +223,16 @@ button.popup-notification-dropmarker {
} }
/* Extensions or similar */ /* Extensions or similar */
#urlbar:not([breakout-extend="true"]) #identity-box.chromeUI:not([pageproxystate="invalid"]) #identity-icon-box { #urlbar:not([breakout-extend='true']) #identity-box.chromeUI:not([pageproxystate='invalid']) #identity-icon-box {
border-radius: 6px 6px 6px 6px !important; border-radius: 6px 6px 6px 6px !important;
} }
/* Notification Stack */ /* Notification Stack */
.notificationbox-stack { .notificationbox-stack {
background: transparent; background: transparent;
&[notificationside="top"] { &[notificationside='top'] {
position: absolute; position: absolute;
bottom: calc(var(--zen-element-separation) * 1.5); bottom: calc(var(--zen-element-separation) * 1.5);
right: calc(var(--zen-element-separation) * 1.5); right: calc(var(--zen-element-separation) * 1.5);
@@ -258,7 +260,6 @@ button.popup-notification-dropmarker {
align-items: center; align-items: center;
} }
/* Other small tweaks */ /* Other small tweaks */
#nav-bar-customization-target { #nav-bar-customization-target {
/* Don't grow if potentially-user-sized elements (like the searchbar or the /* Don't grow if potentially-user-sized elements (like the searchbar or the
@@ -280,7 +281,7 @@ button.popup-notification-dropmarker {
padding-right: var(--zen-element-separation) !important; padding-right: var(--zen-element-separation) !important;
}*/ }*/
#PersonalToolbar:not([collapsed="true"]) { #PersonalToolbar:not([collapsed='true']) {
padding-bottom: 6px; padding-bottom: 6px;
padding-left: 0 !important; padding-left: 0 !important;
} }

View File

@@ -25,7 +25,7 @@
position: relative; position: relative;
& > * { & > * {
opacity: .6; opacity: 0.6;
} }
&[active='true']::after { &[active='true']::after {
@@ -92,7 +92,6 @@
#navigator-toolbox[zen-user-hover='true']:has(*[open='true']:not(tab):not(#zen-sidepanel-button)), #navigator-toolbox[zen-user-hover='true']:has(*[open='true']:not(tab):not(#zen-sidepanel-button)),
:not([zen-user-hover='true']) :not([zen-user-hover='true'])
) { ) {
& #zen-workspaces-button[as-button='true'] { & #zen-workspaces-button[as-button='true'] {
width: 100% !important; width: 100% !important;
margin: 2px; margin: 2px;
@@ -101,7 +100,7 @@
& .zen-workspace-sidebar-wrapper { & .zen-workspace-sidebar-wrapper {
left: calc(var(--toolbarbutton-outer-padding) + 5px); left: calc(var(--toolbarbutton-outer-padding) + 5px);
width: calc(100% - (var(--toolbarbutton-outer-padding) * 3 )); width: calc(100% - (var(--toolbarbutton-outer-padding) * 3));
} }
} }

View File

@@ -506,8 +506,10 @@ var gZenLooksAndFeel = {
const radios = [...chooser.querySelectorAll('input')]; const radios = [...chooser.querySelectorAll('input')];
let value = ''; let value = '';
if (Services.prefs.getBoolPref('zen.view.compact.hide-tabbar') if (
&& Services.prefs.getBoolPref('zen.view.compact.hide-toolbar')) { Services.prefs.getBoolPref('zen.view.compact.hide-tabbar') &&
Services.prefs.getBoolPref('zen.view.compact.hide-toolbar')
) {
value = 'both'; value = 'both';
} else { } else {
value = Services.prefs.getBoolPref('zen.view.compact.hide-tabbar') ? 'left' : 'top'; value = Services.prefs.getBoolPref('zen.view.compact.hide-tabbar') ? 'left' : 'top';
@@ -517,7 +519,7 @@ var gZenLooksAndFeel = {
if (Services.prefs.getBoolPref('zen.view.sidebar-expanded.on-hover')) { if (Services.prefs.getBoolPref('zen.view.sidebar-expanded.on-hover')) {
document.querySelector(`#zen-expand-tabbar-strat input[value='expand']`).click(); document.querySelector(`#zen-expand-tabbar-strat input[value='expand']`).click();
} }
} };
for (let radio of radios) { for (let radio of radios) {
radio.addEventListener('change', (e) => { radio.addEventListener('change', (e) => {
let value = e.target.value; let value = e.target.value;
@@ -560,7 +562,7 @@ var gZenLooksAndFeel = {
} else if (Services.prefs.getBoolPref('zen.view.compact')) { } else if (Services.prefs.getBoolPref('zen.view.compact')) {
document.getElementById('zenLooksAndFeelShowCompactView').click(); document.getElementById('zenLooksAndFeelShowCompactView').click();
} }
} };
for (let radio of radios) { for (let radio of radios) {
radio.addEventListener('change', (e) => { radio.addEventListener('change', (e) => {
switch (e.target.value) { switch (e.target.value) {
@@ -643,35 +645,35 @@ const ZEN_CKS_GROUP_PREFIX = `${ZEN_CKS_CLASS_BASE}-group`;
const KEYBIND_ATTRIBUTE_KEY = 'key'; const KEYBIND_ATTRIBUTE_KEY = 'key';
var zenMissingKeyboardShortcutL10n = { var zenMissingKeyboardShortcutL10n = {
key_quickRestart: "zen-key-quick-restart", key_quickRestart: 'zen-key-quick-restart',
key_delete: "zen-key-delete", key_delete: 'zen-key-delete',
goBackKb: "zen-key-go-back", goBackKb: 'zen-key-go-back',
goForwardKb: "zen-key-go-forward", goForwardKb: 'zen-key-go-forward',
key_enterFullScreen: "zen-key-enter-full-screen", key_enterFullScreen: 'zen-key-enter-full-screen',
key_exitFullScreen: "zen-key-exit-full-screen", key_exitFullScreen: 'zen-key-exit-full-screen',
key_aboutProcesses: "zen-key-about-processes", key_aboutProcesses: 'zen-key-about-processes',
key_stop: "zen-key-stop", key_stop: 'zen-key-stop',
key_sanitize: "zen-key-sanitize", key_sanitize: 'zen-key-sanitize',
key_wrCaptureCmd: "zen-key-wr-capture-cmd", key_wrCaptureCmd: 'zen-key-wr-capture-cmd',
key_wrToggleCaptureSequenceCmd: "zen-key-wr-toggle-capture-sequence-cmd", key_wrToggleCaptureSequenceCmd: 'zen-key-wr-toggle-capture-sequence-cmd',
key_undoCloseWindow: "zen-key-undo-close-window", key_undoCloseWindow: 'zen-key-undo-close-window',
key_selectTab1: "zen-key-select-tab-1", key_selectTab1: 'zen-key-select-tab-1',
key_selectTab2: "zen-key-select-tab-2", key_selectTab2: 'zen-key-select-tab-2',
key_selectTab3: "zen-key-select-tab-3", key_selectTab3: 'zen-key-select-tab-3',
key_selectTab4: "zen-key-select-tab-4", key_selectTab4: 'zen-key-select-tab-4',
key_selectTab5: "zen-key-select-tab-5", key_selectTab5: 'zen-key-select-tab-5',
key_selectTab6: "zen-key-select-tab-6", key_selectTab6: 'zen-key-select-tab-6',
key_selectTab7: "zen-key-select-tab-7", key_selectTab7: 'zen-key-select-tab-7',
key_selectTab8: "zen-key-select-tab-8", key_selectTab8: 'zen-key-select-tab-8',
key_selectLastTab: "zen-key-select-tab-last", key_selectLastTab: 'zen-key-select-tab-last',
key_showAllTabs: "zen-key-show-all-tabs", key_showAllTabs: 'zen-key-show-all-tabs',
key_gotoHistory: "zen-key-goto-history", key_gotoHistory: 'zen-key-goto-history',
goHome: "zen-key-go-home", goHome: 'zen-key-go-home',
key_redo: "zen-key-redo", key_redo: 'zen-key-redo',
} };
var gZenCKSSettings = { var gZenCKSSettings = {
async init() { async init() {
@@ -777,9 +779,11 @@ var gZenCKSSettings = {
if (!this._hasSafed) { if (!this._hasSafed) {
target.classList.add(`${ZEN_CKS_INPUT_FIELD_CLASS}-unsafed`); target.classList.add(`${ZEN_CKS_INPUT_FIELD_CLASS}-unsafed`);
if (!target.nextElementSibling) { if (!target.nextElementSibling) {
target.after(window.MozXULElement.parseXULToFragment(` target.after(
window.MozXULElement.parseXULToFragment(`
<label class="${ZEN_CKS_CLASS_BASE}-unsafed" data-l10n-id="zen-key-unsafed"></label> <label class="${ZEN_CKS_CLASS_BASE}-unsafed" data-l10n-id="zen-key-unsafed"></label>
`)); `)
);
target.value = 'Not set'; target.value = 'Not set';
} }
} else { } else {
@@ -842,7 +846,9 @@ var gZenCKSSettings = {
} else if (shortcut == 'Escape' && !modifiersActive) { } else if (shortcut == 'Escape' && !modifiersActive) {
const hasConflicts = gZenKeyboardShortcutsManager.checkForConflicts( const hasConflicts = gZenKeyboardShortcutsManager.checkForConflicts(
this._latestValidKey ? this._latestValidKey : shortcut, this._latestValidKey ? this._latestValidKey : shortcut,
this._latestModifier ? this._latestModifier : modifiers, this._currentActionID); this._latestModifier ? this._latestModifier : modifiers,
this._currentActionID
);
if (!this._latestValidKey && !this._latestModifier) { if (!this._latestValidKey && !this._latestModifier) {
} else if (!this._latestValidKey || hasConflicts) { } else if (!this._latestValidKey || hasConflicts) {
@@ -851,9 +857,11 @@ var gZenCKSSettings = {
} }
input.classList.remove(`${ZEN_CKS_INPUT_FIELD_CLASS}-unsafed`); input.classList.remove(`${ZEN_CKS_INPUT_FIELD_CLASS}-unsafed`);
if (hasConflicts && !input.nextElementSibling) { if (hasConflicts && !input.nextElementSibling) {
input.after(window.MozXULElement.parseXULToFragment(` input.after(
window.MozXULElement.parseXULToFragment(`
<label class="${ZEN_CKS_CLASS_BASE}-conflict" data-l10n-id="zen-key-conflict"></label> <label class="${ZEN_CKS_CLASS_BASE}-conflict" data-l10n-id="zen-key-conflict"></label>
`)); `)
);
} }
} else { } else {
input.classList.remove(`${ZEN_CKS_INPUT_FIELD_CLASS}-editing`); input.classList.remove(`${ZEN_CKS_INPUT_FIELD_CLASS}-editing`);
@@ -972,5 +980,5 @@ Preferences.addAll([
id: 'zen.tab-unloader.timeout-minutes', id: 'zen.tab-unloader.timeout-minutes',
type: 'int', type: 'int',
default: 10, default: 10,
} },
]); ]);

View File

@@ -54,9 +54,7 @@
} }
}, },
"license": { "license": {
"ignoredFiles": [ "ignoredFiles": [".*\\.json"],
".*\\.json"
],
"licenseType": "MPL-2.0" "licenseType": "MPL-2.0"
}, },
"updateHostname": "updates.zen-browser.app" "updateHostname": "updates.zen-browser.app"