forked from ZenBrowserMirrors/zen-desktop
feat: Inherti the split view type when opening a new link, b=(no-bug), c=split-view
This commit is contained in:
parent
18944d5ed8
commit
21f3ab23d3
5 changed files with 18 additions and 6 deletions
|
@ -50,3 +50,6 @@ pref("app.update.checkInstallTime.days", 6);
|
||||||
// TODO: Check this out!
|
// TODO: Check this out!
|
||||||
pref("browser.profiles.enabled", false);
|
pref("browser.profiles.enabled", false);
|
||||||
pref("browser.tabs.groups.enabled", false);
|
pref("browser.tabs.groups.enabled", false);
|
||||||
|
|
||||||
|
// Open new download in the current tabs
|
||||||
|
pref("browser.link.open_newwindow", 1);
|
||||||
|
|
|
@ -22,7 +22,7 @@ pref('zen.mediacontrols.enabled', true);
|
||||||
// Exposure:
|
// Exposure:
|
||||||
pref('zen.haptic-feedback.enabled', true);
|
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
|
#ifdef MOZILLA_OFFICIAL
|
||||||
pref('zen.mods.auto-update', true);
|
pref('zen.mods.auto-update', true);
|
||||||
pref('zen.rice.api.url', 'https://share.zen-browser.app', locked);
|
pref('zen.rice.api.url', 'https://share.zen-browser.app', locked);
|
||||||
|
|
|
@ -209,7 +209,7 @@ var gZenMarketplaceManager = {
|
||||||
|
|
||||||
for (const mod of Object.values(mods)) {
|
for (const mod of Object.values(mods)) {
|
||||||
mod.modId = mod.id;
|
mod.modId = mod.id;
|
||||||
window.ZenInstallMod(mod);
|
await window.ZenInstallMod(mod);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('[ZenSettings:ZenMods]: Error while importing mods:', error);
|
console.error('[ZenSettings:ZenMods]: Error while importing mods:', error);
|
||||||
|
|
|
@ -435,6 +435,11 @@
|
||||||
|
|
||||||
#zen-glance-sidebar-split {
|
#zen-glance-sidebar-split {
|
||||||
list-style-image: url('split.svg');
|
list-style-image: url('split.svg');
|
||||||
|
|
||||||
|
&[disabled='true'] {
|
||||||
|
opacity: 0.5;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#sidebar-box[sidebarcommand='viewTabsSidebar']
|
#sidebar-box[sidebarcommand='viewTabsSidebar']
|
||||||
|
|
|
@ -897,7 +897,9 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
|
||||||
tabCount: window.gBrowser.selectedTabs.length,
|
tabCount: window.gBrowser.selectedTabs.length,
|
||||||
});
|
});
|
||||||
document.getElementById('context_zenSplitTabs').setAttribute('data-l10n-args', tabCountInfo);
|
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;
|
window.gContextMenu.target.ownerDocument.location.href;
|
||||||
const currentTab = gZenGlanceManager.getTabOrGlanceParent(window.gBrowser.selectedTab);
|
const currentTab = gZenGlanceManager.getTabOrGlanceParent(window.gBrowser.selectedTab);
|
||||||
const newTab = this.openAndSwitchToTab(url, { inBackground: false });
|
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.
|
* Splits the given tabs.
|
||||||
*
|
*
|
||||||
* @param {Tab[]} tabs - The tabs to split.
|
* @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) {
|
splitTabs(tabs, gridType, initialIndex = 0) {
|
||||||
// TODO: Add support for splitting essential tabs
|
// TODO: Add support for splitting essential tabs
|
||||||
|
@ -1874,9 +1876,11 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
|
||||||
}
|
}
|
||||||
|
|
||||||
maybeDisableOpeningTabOnSplitView() {
|
maybeDisableOpeningTabOnSplitView() {
|
||||||
|
const shouldBeDisabled = !this.canOpenLinkInSplitView();
|
||||||
document
|
document
|
||||||
.getElementById('cmd_zenSplitViewLinkInNewTab')
|
.getElementById('cmd_zenSplitViewLinkInNewTab')
|
||||||
.setAttribute('disabled', !this.canOpenLinkInSplitView());
|
.setAttribute('disabled', shouldBeDisabled);
|
||||||
|
document.getElementById('zen-glance-sidebar-split').setAttribute('disabled', shouldBeDisabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
canOpenLinkInSplitView() {
|
canOpenLinkInSplitView() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue