Modification request for stack tabs by host behavior
-
Would it be possible to revert this:
[Tabs] Stacking by host should include tabs inside existing stacks (VB-84834)
??I made a feature request feature request post for the option to be toggleable but it since hasn't been implemented yet.
Tab stacks combining is annoying and ever since the feature I would like to be reverted was implemented I haven't been able to use stacking tabs by host because it now makes my tab stacks unusable.
Thanks for any help ahead of time.
Browser info:
Vivaldi 6.7.3329.17 (Stable channel) (64-bit)
Revision 70a2f5a16071836018e8cb6c2ca7e835a78e4fa5
OS Windows 10 Version 22H2 (Build 19045.4170) -
This code has not been fully tested and may not work properly.
If you actually want to use it, you need to call the code from Custom Keyboard Shortcuts Mod, etc.const getActiveWorkspaceId = async () => { const [tabId] = await chrome.tabs.query({ active: true, currentWindow: true }); return JSON.parse(tabId.vivExtData).workspaceId; } const addTabStack = async (tabId, groupId) => { const tabInfo = await chrome.tabs.get(tabId); const extData = JSON.parse(tabInfo.vivExtData); extData.group = groupId; await chrome.tabs.update(tabId, { vivExtData: JSON.stringify(extData) }); }; const stackTabsByHosts = async () => { const activeWorkspaceId = await getActiveWorkspaceId(); const tabs = (await chrome.tabs.query({ currentWindow: true })) .map(tabInfo => Object.assign(tabInfo, { vivExtData: JSON.parse(tabInfo.vivExtData) })) .filter(tabInfo => !tabInfo.pinned) .filter(tabInfo => !tabInfo.vivExtData.group) .filter(tabInfo => tabInfo.vivExtData.workspaceId === activeWorkspaceId) .reduce((data, tabInfo) => { data.push({ tabId: tabInfo.id, hostname: new URL(tabInfo.url).hostname, }); return data; }, []); const tabGroups = Object.values(Object.groupBy(tabs, ({hostname}) => hostname)).filter(e => e.length > 1); for (const tabGroup of tabGroups) { const groupId = crypto.randomUUID(); for (const {tabId} of tabGroup) { addTabStack(tabId, groupId); } } }; stackTabsByHosts();
-
Although it is not recommended, you can also revert “Stack Tabs by Hosts” to its previous behavior by editing
bundle.js
.-
Open
<install path>\Application\*\resources\vivaldi\bundle.js
in a text editor. -
Find the string
getExistingHostGroups
. -
Replace
filter((e=>!e.pinned)).groupBy
aftergetExistingHostGroups
withfilter((e=>!e.pinned)).filter((e) => !e.vivExtData.group).groupBy
.
-