Skip to content

Commit 68191d2

Browse files
committed
Merge branch 'dev' of https://github.com/zen-browser/desktop into dev
2 parents 81f7587 + d5e2acf commit 68191d2

File tree

10 files changed

+34
-79
lines changed

10 files changed

+34
-79
lines changed

src/browser/app/profile/features.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pref('zen.mediacontrols.enabled', true);
2222
// Exposure:
2323
pref('zen.haptic-feedback.enabled', true);
2424

25-
pref('zen.mods.auto-update-days', 12); // In days
25+
pref('zen.mods.auto-update-days', 20); // In days
2626
#ifdef MOZILLA_OFFICIAL
2727
pref('zen.mods.auto-update', true);
2828
pref('zen.rice.api.url', 'https://share.zen-browser.app', locked);

src/browser/components/preferences/zen-settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ var gZenMarketplaceManager = {
209209

210210
for (const mod of Object.values(mods)) {
211211
mod.modId = mod.id;
212-
window.ZenInstallMod(mod);
212+
await window.ZenInstallMod(mod);
213213
}
214214
} catch (error) {
215215
console.error('[ZenSettings:ZenMods]: Error while importing mods:', error);

src/browser/components/preferences/zenMarketplace.inc.xhtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<button id="zenThemeMarketplaceCheckForUpdates" data-l10n-id="zen-theme-marketplace-check-for-updates-button" />
2121
</hbox>
2222

23-
<checkbox id="zenWorkspacesForceContainerTabsToWorkspace"
23+
<checkbox id="zenThemeMarketplaceAutoUpdate"
2424
data-l10n-id="zen-themes-auto-update"
2525
preference="zen.mods.auto-update"/>
2626

src/browser/components/tabbrowser/content/tabs-js.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
2-
index 84d633471c89230b981d8a07babef4e0c76c0338..ac51c64014b805e2130ffe6698b439b5df1b6d78 100644
2+
index 84d633471c89230b981d8a07babef4e0c76c0338..de8b1ecf7cb844f6cf3e66a41b6024c574dfc103 100644
33
--- a/browser/components/tabbrowser/content/tabs.js
44
+++ b/browser/components/tabbrowser/content/tabs.js
55
@@ -83,7 +83,7 @@
@@ -195,7 +195,7 @@ index 84d633471c89230b981d8a07babef4e0c76c0338..ac51c64014b805e2130ffe6698b439b5
195195
+ if (glanceTab) {
196196
+ // insert right after the parent tab. note: it must be inserted before
197197
+ // the last pinned tab so it can be inserted in the correct order
198-
+ allTabs.splice(Math.max(i++, lastPinnedTabIdx), 0, glanceTab);
198+
+ allTabs.splice(Math.max(i++ + 1, lastPinnedTabIdx), 0, glanceTab);
199199
+ } else if (tab.classList.contains("vertical-pinned-tabs-container-separator")) {
200200
+ // remove the separator from the list
201201
+ allTabs.splice(i, 1);

src/browser/themes/shared/zen-icons/icons.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,11 @@
435435

436436
#zen-glance-sidebar-split {
437437
list-style-image: url('split.svg');
438+
439+
&[disabled='true'] {
440+
opacity: 0.5;
441+
cursor: not-allowed;
442+
}
438443
}
439444

440445
#sidebar-box[sidebarcommand='viewTabsSidebar']

src/zen/common/ZenSessionStore.mjs

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
this.#waitAndCleanup();
88
}
99

10-
#glanceTabs = {};
1110
promiseInitialized = new Promise((resolve) => {
1211
this._resolveInitialized = resolve;
1312
});
@@ -34,67 +33,16 @@
3433
if (tabData.zenPinnedEntry) {
3534
tab.setAttribute('zen-pinned-entry', tabData.zenPinnedEntry);
3635
}
37-
if (tabData.zenGlanceId) {
38-
// We just found the background used for glance. Find
39-
// the current
40-
if (tabData.zenIsGlance) {
41-
if (this.#glanceTabs[tabData.zenGlanceId]) {
42-
this.#glanceTabs[tabData.zenGlanceId].tab = tab;
43-
} else {
44-
this.#glanceTabs[tabData.zenGlanceId] = {
45-
tab: tab,
46-
background: null,
47-
};
48-
}
49-
} else {
50-
if (this.#glanceTabs[tabData.zenGlanceId]) {
51-
this.#glanceTabs[tabData.zenGlanceId].background = tab;
52-
} else {
53-
this.#glanceTabs[tabData.zenGlanceId] = {
54-
tab: null,
55-
background: tab,
56-
};
57-
}
58-
}
59-
}
60-
}
61-
62-
async #resolveGlanceTabs() {
63-
for (const [id, data] of Object.entries(this.#glanceTabs)) {
64-
const { tab, background } = data;
65-
// TODO(Restore glance tab): Finish this implementation
66-
continue;
67-
68-
if (!tab || !background) {
69-
tab?.removeAttribute('glance-id');
70-
background?.removeAttribute('glance-id');
71-
continue;
72-
}
73-
console.log(tab, background);
74-
const browserRect = gBrowser.tabbox.getBoundingClientRect();
75-
await gZenGlanceManager.openGlance(
76-
{
77-
url: undefined,
78-
clientX: browserRect.width / 2,
79-
clientY: browserRect.height / 2,
80-
width: 0,
81-
height: 0,
82-
},
83-
tab,
84-
background
85-
);
86-
}
8736
}
8837

8938
async #waitAndCleanup() {
9039
await SessionStore.promiseAllWindowsRestored;
91-
await this.#resolveGlanceTabs();
40+
await SessionStore.promiseInitialized;
9241
this.#cleanup();
9342
}
9443

9544
#cleanup() {
9645
this._resolveInitialized();
97-
delete window.gZenSessionStore;
9846
}
9947
}
10048

src/zen/common/styles/zen-popup.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,6 @@ panel {
243243
opacity: 0;
244244
}
245245

246-
menupopup::part(content),
247-
panel::part(content) {
248-
border: var(--zen-appcontent-border);
249-
}
250-
251246
menupopup,
252247
panel {
253248
box-shadow: none;

src/zen/split-view/ZenViewSplitter.mjs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,9 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
897897
tabCount: window.gBrowser.selectedTabs.length,
898898
});
899899
document.getElementById('context_zenSplitTabs').setAttribute('data-l10n-args', tabCountInfo);
900-
document.getElementById('context_zenSplitTabs').disabled = !this.contextCanSplitTabs();
900+
document
901+
.getElementById('context_zenSplitTabs')
902+
.setAttribute('disabled', !this.contextCanSplitTabs());
901903
});
902904
}
903905

@@ -951,7 +953,7 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
951953
window.gContextMenu.target.ownerDocument.location.href;
952954
const currentTab = gZenGlanceManager.getTabOrGlanceParent(window.gBrowser.selectedTab);
953955
const newTab = this.openAndSwitchToTab(url, { inBackground: false });
954-
this.splitTabs([currentTab, newTab], 'grid', 1);
956+
this.splitTabs([currentTab, newTab], undefined, 1);
955957
}
956958

957959
/**
@@ -1028,7 +1030,7 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
10281030
* Splits the given tabs.
10291031
*
10301032
* @param {Tab[]} tabs - The tabs to split.
1031-
* @param {string} gridType - The type of grid layout.
1033+
* @param {string|undefined} gridType - The type of grid layout.
10321034
*/
10331035
splitTabs(tabs, gridType, initialIndex = 0) {
10341036
// TODO: Add support for splitting essential tabs
@@ -1874,9 +1876,11 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
18741876
}
18751877

18761878
maybeDisableOpeningTabOnSplitView() {
1879+
const shouldBeDisabled = !this.canOpenLinkInSplitView();
18771880
document
18781881
.getElementById('cmd_zenSplitViewLinkInNewTab')
1879-
.setAttribute('disabled', !this.canOpenLinkInSplitView());
1882+
.setAttribute('disabled', shouldBeDisabled);
1883+
document.getElementById('zen-glance-sidebar-split').setAttribute('disabled', shouldBeDisabled);
18801884
}
18811885

18821886
canOpenLinkInSplitView() {

src/zen/tabs/ZenPinnedTabManager.mjs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,11 @@
9090

9191
onTabIconChanged(tab, url = null) {
9292
const iconUrl = url ?? tab.iconImage.src;
93-
if (!iconUrl) {
93+
if (!iconUrl && tab.hasAttribute('zen-pin-id')) {
9494
try {
9595
setTimeout(async () => {
9696
try {
97+
await this.promisePinnedCacheInitialized;
9798
const pin = this._pinsCache?.find(
9899
(pin) => pin.uuid === tab.getAttribute('zen-pin-id')
99100
);
@@ -162,6 +163,9 @@
162163
await gZenWorkspaces.promiseSectionsInitialized;
163164
await this._initializePinsCache();
164165
await this._initializePinnedTabs(init);
166+
if (init) {
167+
this._resolveInitializedPinnedCache();
168+
}
165169
}
166170

167171
async _initializePinsCache() {
@@ -637,17 +641,12 @@
637641
this.resetPinChangedUrl(tab);
638642
}
639643

640-
async getFaviconAsBase64(pageUrl, secondTry = false) {
644+
async getFaviconAsBase64(pageUrl) {
641645
try {
642646
const faviconData = await PlacesUtils.favicons.getFaviconForPage(pageUrl);
643647
if (!faviconData) {
644-
if (secondTry || pageUrl.spec.startsWith('about:')) {
645-
// empty favicon
646-
return 'data:image/png;base64,';
647-
}
648-
// Try again with the domain
649-
const domainUrl = pageUrl.spec.substring(0, pageUrl.spec.indexOf('/'));
650-
return await this.getFaviconAsBase64(Services.io.newURI(domainUrl), true);
648+
// empty favicon
649+
return 'data:image/png;base64,';
651650
}
652651
return faviconData.dataURI;
653652
} catch (ex) {
@@ -954,7 +953,7 @@
954953
} else {
955954
tab.setAttribute('zen-pinned-changed', 'true');
956955
}
957-
tab.style.setProperty('--zen-original-tab-icon', `url(${pin.iconUrl})`);
956+
tab.style.setProperty('--zen-original-tab-icon', `url(${pin.iconUrl.spec})`);
958957
}
959958

960959
removeTabContainersDragoverClass() {
@@ -1135,4 +1134,8 @@
11351134
}
11361135

11371136
window.gZenPinnedTabManager = new ZenPinnedTabManager();
1137+
1138+
gZenPinnedTabManager.promisePinnedCacheInitialized = new Promise((resolve) => {
1139+
gZenPinnedTabManager._resolveInitializedPinnedCache = resolve;
1140+
});
11381141
}

src/zen/tabs/ZenPinnedTabsStorage.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ var ZenPinnedTabsStorage = {
109109
`
110110
INSERT OR REPLACE INTO zen_pins (
111111
uuid, title, url, container_id, workspace_uuid, position,
112-
is_essential, is_group, parent_uuid, created_at, updated_at,
113-
edited_title
112+
is_essential, is_group, parent_uuid, edited_title, created_at,
113+
updated_at
114114
) VALUES (
115115
:uuid, :title, :url, :container_id, :workspace_uuid, :position,
116116
:is_essential, :is_group, :parent_uuid, :edited_title,

0 commit comments

Comments
 (0)