mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-16 23:06:30 +00:00
Merge branch 'dev' into media-control
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
|
||||
openWatermark() {
|
||||
if (!Services.prefs.getBoolPref('zen.watermark.enabled', false)) {
|
||||
document.documentElement.removeAttribute('zen-before-loaded');
|
||||
return;
|
||||
}
|
||||
for (let elem of document.querySelectorAll('#browser > *, #urlbar')) {
|
||||
|
Binary file not shown.
Binary file not shown.
@@ -19,12 +19,6 @@
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
@media not (-moz-bool-pref: 'zen.watermark.enabled') {
|
||||
#zen-watermark {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
#customization-footer #customization-toolbar-visibility-button {
|
||||
display: none !important;
|
||||
}
|
||||
|
10
src/browser/base/moz-build.patch
Normal file
10
src/browser/base/moz-build.patch
Normal file
@@ -0,0 +1,10 @@
|
||||
diff --git a/browser/base/moz.build b/browser/base/moz.build
|
||||
index 636e0841786735a63ddea00e819c0b6f0b8a5d4d..6685d857180944d68bf4f049919f81361084c481 100644
|
||||
--- a/browser/base/moz.build
|
||||
+++ b/browser/base/moz.build
|
||||
@@ -87,3 +87,5 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("windows", "gtk"):
|
||||
DEFINES["MENUBAR_CAN_AUTOHIDE"] = 1
|
||||
|
||||
JAR_MANIFESTS += ["jar.mn"]
|
||||
+
|
||||
+DIRS += ["zen-components"]
|
@@ -211,6 +211,11 @@
|
||||
return;
|
||||
}
|
||||
|
||||
let { permitUnload } = this.#currentBrowser.permitUnload();
|
||||
if (!permitUnload) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (onTabClose && hasFocused && !this.#confirmationTimeout) {
|
||||
const cancelButton = document.getElementById('zen-glance-sidebar-close');
|
||||
cancelButton.setAttribute('waitconfirmation', true);
|
||||
@@ -300,7 +305,6 @@
|
||||
}
|
||||
|
||||
// reset everything
|
||||
const prevOverlay = this.overlay;
|
||||
this.browserWrapper = null;
|
||||
this.overlay = null;
|
||||
this.contentWrapper = null;
|
||||
@@ -312,7 +316,7 @@
|
||||
gBrowser.selectedTab = this.#currentParentTab;
|
||||
}
|
||||
this._ignoreClose = true;
|
||||
gBrowser.removeTab(this.lastCurrentTab, { animate: true });
|
||||
gBrowser.removeTab(this.lastCurrentTab, { animate: true, skipPermitUnload: true });
|
||||
gBrowser.tabContainer._invalidateCachedTabs();
|
||||
|
||||
this.#currentParentTab.removeAttribute('glance-id');
|
||||
|
@@ -27,7 +27,6 @@ class ZenBrowserManagerSidebar extends ZenDOMOperatedFeature {
|
||||
this.onlySafeWidthAndHeight();
|
||||
|
||||
this.initProgressListener();
|
||||
this.update();
|
||||
this.close(); // avoid caching
|
||||
this.tabBox.prepend(this.sidebarWrapper);
|
||||
this.listenForPrefChanges();
|
||||
@@ -557,16 +556,18 @@ class ZenBrowserManagerSidebar extends ZenDOMOperatedFeature {
|
||||
_getWebPanelIcon(url, element) {
|
||||
let { preferredURI } = Services.uriFixup.getFixupURIInfo(url);
|
||||
element.setAttribute('image', `page-icon:${preferredURI.spec}`);
|
||||
fetch(`https://s2.googleusercontent.com/s2/favicons?domain_url=${preferredURI.spec}`).then(async (response) => {
|
||||
if (response.ok) {
|
||||
let blob = await response.blob();
|
||||
let reader = new FileReader();
|
||||
reader.onload = function () {
|
||||
element.setAttribute('image', reader.result);
|
||||
};
|
||||
reader.readAsDataURL(blob);
|
||||
}
|
||||
});
|
||||
if (Services.prefs.getBoolPref('zen.sidebar.use-google-favicons')) {
|
||||
fetch(`https://s2.googleusercontent.com/s2/favicons?domain_url=${preferredURI.spec}`).then(async (response) => {
|
||||
if (response.ok) {
|
||||
let blob = await response.blob();
|
||||
let reader = new FileReader();
|
||||
reader.onload = function () {
|
||||
element.setAttribute('image', reader.result);
|
||||
};
|
||||
reader.readAsDataURL(blob);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
_getBrowserById(id) {
|
||||
|
@@ -36,6 +36,10 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
this._resolveInitialized = resolve;
|
||||
});
|
||||
|
||||
promiseEmptyTabInitialized = new Promise((resolve) => {
|
||||
this._resolveEmptyTabInitialized = resolve;
|
||||
});
|
||||
|
||||
workspaceIndicatorXUL = `
|
||||
<hbox class="zen-current-workspace-indicator-icon"></hbox>
|
||||
<hbox class="zen-current-workspace-indicator-name"></hbox>
|
||||
@@ -145,6 +149,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
}
|
||||
|
||||
_initializeEmptyTab() {
|
||||
if (Services.prefs.getBoolPref('zen.workspaces.disable_empty_state_for_testing', false)) {
|
||||
return;
|
||||
}
|
||||
this._emptyTab = gBrowser.addTrustedTab('about:blank', { inBackground: true, userContextId: 0, _forZenEmptyTab: true });
|
||||
}
|
||||
|
||||
@@ -603,16 +610,22 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
} catch (e) {
|
||||
console.error('ZenWorkspaces: Error initializing theme picker', e);
|
||||
}
|
||||
this._selectStartPage();
|
||||
await this._selectStartPage();
|
||||
this._fixTabPositions();
|
||||
this._resolveInitialized();
|
||||
this._clearAnyZombieTabs(); // Dont call with await
|
||||
}
|
||||
}
|
||||
|
||||
_selectStartPage() {
|
||||
async _selectStartPage() {
|
||||
if (Services.prefs.getBoolPref('zen.workspaces.disable_empty_state_for_testing', false)) {
|
||||
return;
|
||||
}
|
||||
const currentTab = gBrowser.selectedTab;
|
||||
let showed = false;
|
||||
await this.promiseEmptyTabInitialized;
|
||||
this._resolveEmptyTabInitialized = null;
|
||||
this.promiseEmptyTabInitialized = null;
|
||||
if (currentTab.pinned) {
|
||||
this.selectEmptyTab();
|
||||
try {
|
||||
|
4
src/browser/base/zen-components/moz.build
Normal file
4
src/browser/base/zen-components/moz.build
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
BROWSER_CHROME_MANIFESTS += [
|
||||
"tests/browser.toml",
|
||||
]
|
Reference in New Issue
Block a user