Lej77 / tab-count-in-window-title

6 stars 1 forks source link

TreeStyleTab hide-when-single-window hack doesn't work anymore #4

Closed ELLIOTTCABLE closed 5 years ago

ELLIOTTCABLE commented 5 years ago

Using this extension, and your CSS hack from piroor/treestyletab#1768 doesn't seem to be working anymore, as of FireFox 65, possibly?

  1. I have this extension installed (the latest version, v4.7), though I don't think I see any counts in the titles …
  2. With TST 2.7.22,
  3. And FireFox 65.0.1,
  4. Using the following userChrome.css:
#main-window[tabsintitlebar="true"]:not([extradragspace="true"]) #TabsToolbar {
  opacity: 0;
  pointer-events: none;
}

#main-window:not([tabsintitlebar="true"]) #TabsToolbar {
    visibility: collapse !important;
}

/* For only Tree Style Tab sidebar #1397 */

#sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] #sidebar-header {
  display: none;
}

/* Auto-hide sidebar in windows with only one tab (requires another extension) #1768 */

#main-window[titlepreface="[1] "] #sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] {
  visibility: collapse !important;
}

Am I doing something wrong? I'm not sure what changed. )=

nvillotti commented 5 years ago

I am having this problem as well across multiple machines.

Lej77 commented 5 years ago

The last version of this extension (v4.7) changed the title prefix for default settings to allow for using window names. This accidentally caused an extra space to be added to the default prefix so that the prefix ended with two spaces. This made no visibly change but did affect this CSS code since the titlepreface attribute value needed to be exactly equal to [1] (with only one space). I have updated the extension (v4.8) to remove the extra space in the default settings to fix the problem. So updating the extension should fix the issue.

On a related note I also changed the code snippet in the Tree Style Tab wiki to:

#main-window[titlepreface^="[1] "] #sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] {
  visibility: collapse !important;
}

note the extra ^ before the = sign. CSS attribute selectors are not limited to checking that an attributes value is exactly equal to something. This change makes it so that it only check that the prefix starts with [1] which would work even in version 4.7 of the addon. It also makes it possible to have window names in the prefix and still use this CSS code.