mbnuqw / sidebery

Firefox extension for managing tabs and bookmarks in sidebar.
MIT License
3.2k stars 162 forks source link

Having the Tabs pane hide while on fullscreen #1118

Closed mll0 closed 5 months ago

mll0 commented 1 year ago

Description

Hi, 1 have 3 related questions/feature requests: (Q1) The main FR: I'd like the sidebar to hide when I press F11 (fullscreen), and reappear when I leave fullscreen mode.

(Q2) I'd like that when I Tabs' sidebar is visible, the standard horizontal tabs disappear; and (Q3) when I hide Tabs' sidebar (F1 key by default), I'd like the horizontal tabs to show up.

For the record, this is the native behaviour in Vivaldi.

This is a bit related to https://github.com/mbnuqw/sidebery/issues/668 I guess, where we have the label "dep: api limitation". But there must be a way through userChrome.css.

TBH, I had achieved this with another similar (but not so well maintained) plugin, but I could not reproduce it with Sidebery. Here is what I had in userChrome.css, for pointers:

For Q1:

/* Hide sidebar in fullscreen
*/

#main-window[inFullscreen="true"] #sidebar-box[sidebarcommand="tabcenter-reborn_ariasuni-sidebar-action"],
#main-window[inFullscreen="true"] #sidebar-box[sidebarcommand="tabcenter-reborn_ariasuni-sidebar-action"]+splitter {
    visibility: collapse;
}

Source

Right now, for Q2 and Q3, here is a poor substitute:

/* Hide the horizontal tab strip

With this trick, the menubar is hidden all the time, except the browser is in customizing mode.
First navigate to about:config and, if it exists, set browser.tabs.drawInTitlebar to false.
*/

#TabsToolbar:not([customizing="true"]) {
    visibility: collapse !important;
}

Still for Q2 and Q3, here is something that used to completely do the job, until a recent Firefox upgrade. This code had to be in a .uc.js file within the chrome folder, after a complicated, partially documented process:

//source: https://github.com/tkhquang/userChrome.css/blob/master/Tree%20Style%20Tab/TST_tabbar.uc.js

// Auto hide tab bar only when Tree Style Tab sidebar is selected and visible.

(function () {
  "use strict";

  const tabbar = document.getElementById("TabsToolbar");
  const sidebarBox = document.getElementById("sidebar-box");
  function showHideTabbar() {
    const sidebarCommand = sidebarBox.getAttribute("sidebarcommand");
    tabbar.style.visibility = (
      (!sidebarBox.hidden && sidebarCommand === "tabcenter-reborn_ariasuni-sidebar-action") ? "collapse" : "visible");
  }
  const observer = new MutationObserver(showHideTabbar);
  observer.observe(sidebarBox, {
    attributes: true,
    attributeFilter: [
      "sidebarcommand",
      "hidden"]
  });
}());

Thank you.

ongots commented 1 year ago

Try this first: https://github.com/ongots/pseudo-fullscreen-firefox For Firefox Beta, use the beta branch. This style is completely disabled horizontal tabs, because their auto-hiding could not be implemented properly.

If horizontal tabs are still needed, try to screw this style: https://github.com/mbnuqw/sidebery/wiki/Firefox-Styles-Snippets-(via-userChrome.css)#dynamic-native-tabs

mll0 commented 1 year ago

Try this first: https://github.com/ongots/pseudo-fullscreen-firefox For Firefox Beta, use the beta branch. This style is completely disabled horizontal tabs, because their auto-hiding could not be implemented properly.

I didn't dare. This seems to change a lot more things than just what I ask in Q1

If horizontal tabs are still needed, try to screw this style: https://github.com/mbnuqw/sidebery/wiki/Firefox-Styles-Snippets-(via-userChrome.css)#dynamic-native-tabs

Perfect solution to Q2 and Q3, thank you! I feel dumb of having missed the wiki... :/

devgid commented 6 months ago

@mll0 Tab pane is part of Firefox sidebar, so your question is rather "How do you hide the sidebar when fullscreen in Firefox"

There are many results of that on the Mozilla forums and google results

Since this is Firefox and not Sidebery related please close this issue.