diff --git a/src/browser/app/profile/features.inc b/src/browser/app/profile/features.inc
index 19078f491..f92e9ba98 100644
--- a/src/browser/app/profile/features.inc
+++ b/src/browser/app/profile/features.inc
@@ -22,7 +22,7 @@ pref('zen.mediacontrols.enabled', true);
// Exposure:
pref('zen.haptic-feedback.enabled', true);
-pref('zen.mods.auto-update-days', 12); // In days
+pref('zen.mods.auto-update-days', 20); // In days
#ifdef MOZILLA_OFFICIAL
pref('zen.mods.auto-update', true);
pref('zen.rice.api.url', 'https://share.zen-browser.app', locked);
diff --git a/src/browser/components/preferences/zen-settings.js b/src/browser/components/preferences/zen-settings.js
index f5f6e4919..179637919 100644
--- a/src/browser/components/preferences/zen-settings.js
+++ b/src/browser/components/preferences/zen-settings.js
@@ -209,7 +209,7 @@ var gZenMarketplaceManager = {
for (const mod of Object.values(mods)) {
mod.modId = mod.id;
- window.ZenInstallMod(mod);
+ await window.ZenInstallMod(mod);
}
} catch (error) {
console.error('[ZenSettings:ZenMods]: Error while importing mods:', error);
diff --git a/src/browser/components/preferences/zenMarketplace.inc.xhtml b/src/browser/components/preferences/zenMarketplace.inc.xhtml
index 0e84c78d0..f2a4dedba 100644
--- a/src/browser/components/preferences/zenMarketplace.inc.xhtml
+++ b/src/browser/components/preferences/zenMarketplace.inc.xhtml
@@ -20,7 +20,7 @@
-
diff --git a/src/browser/components/tabbrowser/content/tabs-js.patch b/src/browser/components/tabbrowser/content/tabs-js.patch
index fcf4d7df9..5a5c695f2 100644
--- a/src/browser/components/tabbrowser/content/tabs-js.patch
+++ b/src/browser/components/tabbrowser/content/tabs-js.patch
@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
-index 84d633471c89230b981d8a07babef4e0c76c0338..ac51c64014b805e2130ffe6698b439b5df1b6d78 100644
+index 84d633471c89230b981d8a07babef4e0c76c0338..de8b1ecf7cb844f6cf3e66a41b6024c574dfc103 100644
--- a/browser/components/tabbrowser/content/tabs.js
+++ b/browser/components/tabbrowser/content/tabs.js
@@ -83,7 +83,7 @@
@@ -195,7 +195,7 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..ac51c64014b805e2130ffe6698b439b5
+ if (glanceTab) {
+ // insert right after the parent tab. note: it must be inserted before
+ // the last pinned tab so it can be inserted in the correct order
-+ allTabs.splice(Math.max(i++, lastPinnedTabIdx), 0, glanceTab);
++ allTabs.splice(Math.max(i++ + 1, lastPinnedTabIdx), 0, glanceTab);
+ } else if (tab.classList.contains("vertical-pinned-tabs-container-separator")) {
+ // remove the separator from the list
+ allTabs.splice(i, 1);
diff --git a/src/browser/themes/shared/zen-icons/icons.css b/src/browser/themes/shared/zen-icons/icons.css
index 3991eb85a..9cf05d3ea 100644
--- a/src/browser/themes/shared/zen-icons/icons.css
+++ b/src/browser/themes/shared/zen-icons/icons.css
@@ -435,6 +435,11 @@
#zen-glance-sidebar-split {
list-style-image: url('split.svg');
+
+ &[disabled='true'] {
+ opacity: 0.5;
+ cursor: not-allowed;
+ }
}
#sidebar-box[sidebarcommand='viewTabsSidebar']
diff --git a/src/zen/common/ZenSessionStore.mjs b/src/zen/common/ZenSessionStore.mjs
index 447a169b5..73c26ee08 100644
--- a/src/zen/common/ZenSessionStore.mjs
+++ b/src/zen/common/ZenSessionStore.mjs
@@ -7,7 +7,6 @@
this.#waitAndCleanup();
}
- #glanceTabs = {};
promiseInitialized = new Promise((resolve) => {
this._resolveInitialized = resolve;
});
@@ -34,67 +33,16 @@
if (tabData.zenPinnedEntry) {
tab.setAttribute('zen-pinned-entry', tabData.zenPinnedEntry);
}
- if (tabData.zenGlanceId) {
- // We just found the background used for glance. Find
- // the current
- if (tabData.zenIsGlance) {
- if (this.#glanceTabs[tabData.zenGlanceId]) {
- this.#glanceTabs[tabData.zenGlanceId].tab = tab;
- } else {
- this.#glanceTabs[tabData.zenGlanceId] = {
- tab: tab,
- background: null,
- };
- }
- } else {
- if (this.#glanceTabs[tabData.zenGlanceId]) {
- this.#glanceTabs[tabData.zenGlanceId].background = tab;
- } else {
- this.#glanceTabs[tabData.zenGlanceId] = {
- tab: null,
- background: tab,
- };
- }
- }
- }
- }
-
- async #resolveGlanceTabs() {
- for (const [id, data] of Object.entries(this.#glanceTabs)) {
- const { tab, background } = data;
- // TODO(Restore glance tab): Finish this implementation
- continue;
-
- if (!tab || !background) {
- tab?.removeAttribute('glance-id');
- background?.removeAttribute('glance-id');
- continue;
- }
- console.log(tab, background);
- const browserRect = gBrowser.tabbox.getBoundingClientRect();
- await gZenGlanceManager.openGlance(
- {
- url: undefined,
- clientX: browserRect.width / 2,
- clientY: browserRect.height / 2,
- width: 0,
- height: 0,
- },
- tab,
- background
- );
- }
}
async #waitAndCleanup() {
await SessionStore.promiseAllWindowsRestored;
- await this.#resolveGlanceTabs();
+ await SessionStore.promiseInitialized;
this.#cleanup();
}
#cleanup() {
this._resolveInitialized();
- delete window.gZenSessionStore;
}
}
diff --git a/src/zen/common/styles/zen-popup.css b/src/zen/common/styles/zen-popup.css
index 72268d333..fc21f5e22 100644
--- a/src/zen/common/styles/zen-popup.css
+++ b/src/zen/common/styles/zen-popup.css
@@ -243,11 +243,6 @@ panel {
opacity: 0;
}
-menupopup::part(content),
-panel::part(content) {
- border: var(--zen-appcontent-border);
-}
-
menupopup,
panel {
box-shadow: none;
diff --git a/src/zen/split-view/ZenViewSplitter.mjs b/src/zen/split-view/ZenViewSplitter.mjs
index ffa68222f..c67b4fa71 100644
--- a/src/zen/split-view/ZenViewSplitter.mjs
+++ b/src/zen/split-view/ZenViewSplitter.mjs
@@ -897,7 +897,9 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
tabCount: window.gBrowser.selectedTabs.length,
});
document.getElementById('context_zenSplitTabs').setAttribute('data-l10n-args', tabCountInfo);
- document.getElementById('context_zenSplitTabs').disabled = !this.contextCanSplitTabs();
+ document
+ .getElementById('context_zenSplitTabs')
+ .setAttribute('disabled', !this.contextCanSplitTabs());
});
}
@@ -951,7 +953,7 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
window.gContextMenu.target.ownerDocument.location.href;
const currentTab = gZenGlanceManager.getTabOrGlanceParent(window.gBrowser.selectedTab);
const newTab = this.openAndSwitchToTab(url, { inBackground: false });
- this.splitTabs([currentTab, newTab], 'grid', 1);
+ this.splitTabs([currentTab, newTab], undefined, 1);
}
/**
@@ -1028,7 +1030,7 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
* Splits the given tabs.
*
* @param {Tab[]} tabs - The tabs to split.
- * @param {string} gridType - The type of grid layout.
+ * @param {string|undefined} gridType - The type of grid layout.
*/
splitTabs(tabs, gridType, initialIndex = 0) {
// TODO: Add support for splitting essential tabs
@@ -1874,9 +1876,11 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
}
maybeDisableOpeningTabOnSplitView() {
+ const shouldBeDisabled = !this.canOpenLinkInSplitView();
document
.getElementById('cmd_zenSplitViewLinkInNewTab')
- .setAttribute('disabled', !this.canOpenLinkInSplitView());
+ .setAttribute('disabled', shouldBeDisabled);
+ document.getElementById('zen-glance-sidebar-split').setAttribute('disabled', shouldBeDisabled);
}
canOpenLinkInSplitView() {
diff --git a/src/zen/tabs/ZenPinnedTabManager.mjs b/src/zen/tabs/ZenPinnedTabManager.mjs
index b981007a4..56ef429d2 100644
--- a/src/zen/tabs/ZenPinnedTabManager.mjs
+++ b/src/zen/tabs/ZenPinnedTabManager.mjs
@@ -90,10 +90,11 @@
onTabIconChanged(tab, url = null) {
const iconUrl = url ?? tab.iconImage.src;
- if (!iconUrl) {
+ if (!iconUrl && tab.hasAttribute('zen-pin-id')) {
try {
setTimeout(async () => {
try {
+ await this.promisePinnedCacheInitialized;
const pin = this._pinsCache?.find(
(pin) => pin.uuid === tab.getAttribute('zen-pin-id')
);
@@ -162,6 +163,9 @@
await gZenWorkspaces.promiseSectionsInitialized;
await this._initializePinsCache();
await this._initializePinnedTabs(init);
+ if (init) {
+ this._resolveInitializedPinnedCache();
+ }
}
async _initializePinsCache() {
@@ -637,17 +641,12 @@
this.resetPinChangedUrl(tab);
}
- async getFaviconAsBase64(pageUrl, secondTry = false) {
+ async getFaviconAsBase64(pageUrl) {
try {
const faviconData = await PlacesUtils.favicons.getFaviconForPage(pageUrl);
if (!faviconData) {
- if (secondTry || pageUrl.spec.startsWith('about:')) {
- // empty favicon
- return 'data:image/png;base64,';
- }
- // Try again with the domain
- const domainUrl = pageUrl.spec.substring(0, pageUrl.spec.indexOf('/'));
- return await this.getFaviconAsBase64(Services.io.newURI(domainUrl), true);
+ // empty favicon
+ return 'data:image/png;base64,';
}
return faviconData.dataURI;
} catch (ex) {
@@ -954,7 +953,7 @@
} else {
tab.setAttribute('zen-pinned-changed', 'true');
}
- tab.style.setProperty('--zen-original-tab-icon', `url(${pin.iconUrl})`);
+ tab.style.setProperty('--zen-original-tab-icon', `url(${pin.iconUrl.spec})`);
}
removeTabContainersDragoverClass() {
@@ -1135,4 +1134,8 @@
}
window.gZenPinnedTabManager = new ZenPinnedTabManager();
+
+ gZenPinnedTabManager.promisePinnedCacheInitialized = new Promise((resolve) => {
+ gZenPinnedTabManager._resolveInitializedPinnedCache = resolve;
+ });
}
diff --git a/src/zen/tabs/ZenPinnedTabsStorage.mjs b/src/zen/tabs/ZenPinnedTabsStorage.mjs
index e1c5c0d41..5dc81b93b 100644
--- a/src/zen/tabs/ZenPinnedTabsStorage.mjs
+++ b/src/zen/tabs/ZenPinnedTabsStorage.mjs
@@ -109,8 +109,8 @@ var ZenPinnedTabsStorage = {
`
INSERT OR REPLACE INTO zen_pins (
uuid, title, url, container_id, workspace_uuid, position,
- is_essential, is_group, parent_uuid, created_at, updated_at,
- edited_title
+ is_essential, is_group, parent_uuid, edited_title, created_at,
+ updated_at
) VALUES (
:uuid, :title, :url, :container_id, :workspace_uuid, :position,
:is_essential, :is_group, :parent_uuid, :edited_title,