From fb6fa85d49ea921c2913c0e7fafeb43fe873e624 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Tue, 20 Aug 2024 00:07:39 +0530 Subject: Add sidebar tabs for firefox --- modules/firefox.home/chrome/globalKeybindings.uc.js | 7 +++++++ modules/firefox.home/chrome/userChrome.css | 17 +++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) (limited to 'modules/firefox.home/chrome') diff --git a/modules/firefox.home/chrome/globalKeybindings.uc.js b/modules/firefox.home/chrome/globalKeybindings.uc.js index dd1f0f7..7341fc0 100644 --- a/modules/firefox.home/chrome/globalKeybindings.uc.js +++ b/modules/firefox.home/chrome/globalKeybindings.uc.js @@ -13,12 +13,16 @@ RELEASE: [ [ctrl(shift(key('J'))), moveSelectedTabBy(+1)], [ctrl(shift(key('K'))), moveSelectedTabBy(-1)], + [ctrl(shift(key('B'))), toggleTabSidebar()], [ctrl(alt(key('p'))), togglePassthrough(), { modes: ALL_MODES }], ], PRESS: [ // Block default key bindings [ctrl(shift(key('J'))), preventDefault()], [ctrl(shift(key('K'))), preventDefault()], + [ctrl(shift(key('B'))), preventDefault()], + [ctrl(key('h')), preventDefault()], + [ctrl(key('b')), preventDefault()], [ctrl(key('j')), preventDefault(nextTab())], [ctrl(key('k')), preventDefault(prevTab())], @@ -37,6 +41,9 @@ const moveSelectedTabBy = incr => () => updateSelectedTabIndex(incr); const togglePassthrough = () => () => UC.globalKeybindings.updateMode(m => m !== MODE_PASSTHRU ? MODE_PASSTHRU : MODE_NORMAL) + const getSidebarId = () => [...SidebarController.sidebars].find(([_, p]) => p.label?.match(/sidetabs/i))?.[0]; + const toggleTabSidebar = () => () => SidebarController.toggle(getSidebarId() ?? undefined); + const MODE_PASSTHRU = 'passthru'; const MODE_NORMAL = ''; const ALL_MODES = [MODE_NORMAL, MODE_PASSTHRU]; diff --git a/modules/firefox.home/chrome/userChrome.css b/modules/firefox.home/chrome/userChrome.css index e888056..99dc670 100644 --- a/modules/firefox.home/chrome/userChrome.css +++ b/modules/firefox.home/chrome/userChrome.css @@ -145,6 +145,19 @@ toolbarbutton#alltabs-button { margin: 0 !important; } -#urlbar[focused='true'] > #urlbar-background { - /* box-shadow: none !important; */ + + +/* Sidebar + tab */ +#TabsToolbar { + visibility: collapse !important; +} +#sidebar-header { + display: none !important; +} +#sidebar-splitter { + display: none !important; } +/* #appcontent { */ +/* border-radius: 4px !important; */ +/* overflow: hidden !important; */ +/* } */ -- cgit v1.3.1