Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Learn More

Hide Tab bar if there is only one tab

  • 12 trả lời
  • 7 gặp vấn đề này
  • 4374 lượt xem
  • Trả lời mới nhất được viết bởi Iceberg_

more options

Hello!

I have been using this userChrome.css code to hide the tab bar if there is only one tab (on Windows):

tab:only-of-type, tab:only-of-type + #tabs-newtab-button {

   display: none !important;

}

#tabbrowser-tabs, #tabbrowser-arrowscrollbox, #tabbrowser-tabs > .tabbrowser-arrowscrollbox {
   min-height: 0 !important;

}

Since one of the recent Firefox updates, this code does no longer work. Maybe because there is a new element in the tab bar: A drop-down list at the right.

Any idea how to make the above code work again?

Peter

Hello! I have been using this userChrome.css code to hide the tab bar if there is only one tab (on Windows): tab:only-of-type, tab:only-of-type + #tabs-newtab-button { display: none !important; } #tabbrowser-tabs, #tabbrowser-arrowscrollbox, #tabbrowser-tabs > .tabbrowser-arrowscrollbox { min-height: 0 !important; } Since one of the recent Firefox updates, this code does no longer work. Maybe because there is a new element in the tab bar: A drop-down list at the right. Any idea how to make the above code work again? Peter

Được chỉnh sửa bởi peter596 vào

Giải pháp được chọn

This code would probably be better as in 110 support for first-visible-tab and last-visible-tab is removed (#1808661).

/* Hide Tab bar with only one Tab - [110] */
#tabbrowser-tabs .tabbrowser-tab:only-of-type,
#tabbrowser-tabs .tabbrowser-tab:only-of-type + #tabbrowser-arrowscrollbox-periphery{
  display:none !important;
}
#tabbrowser-tabs, #tabbrowser-arrowscrollbox {min-height:0!important;}
/* #TabsToolbar:not(:hover) */ #alltabs-button {display:none !important;}

Đọc câu trả lời này trong ngữ cảnh 👍 3

Tất cả các câu trả lời (12)

more options

You can set browser.tabs.tabmanager.enabled = false on the about:config page to hide the "List all tabs" (Tab Manager) button.

You can open the about:config page via the location/address bar. On the warning page, you can click "Accept the Risk and Continue"to open about:config.

Firefox 106+ has a "Firefox View" button at the left end of the Tab bar that you can remove via "Remove from Tab Bar" via the right-click context menu.

more options

Thanks for the quick help! I have set browser.tabs.tabmanager.enabled = false, and indeed the dropdown button at the right has disappeared. But the + button at the left is still there, so the tab bar still does not disappear. It looks like this

tab:only-of-type, tab:only-of-type + #tabs-newtab-button {

  display: none !important;

}

does no longer work with the current Firefox version. Some change or replacement is needed for this code.

more options

Try this code in userChrome.css with the Firefox View button and the the "List all tabs" (Tab Manager) button hidden/removed.

tab[first-visible-tab=true][last-visible-tab=true],
tab[first-visible-tab=true][last-visible-tab=true] + #tabbrowser-arrowscrollbox-periphery{
  display:none!important;
}
#tabbrowser-tabs, #tabbrowser-arrowscrollbox {min-height: 0 !important;}

more options

This works. Thanks a lot!

more options

I had the same problem with FF106 and cor-el's solution worked for me as well. Many thanks.

more options

I have this problem again, having just upgraded to Firefox 110, despite having the code above. Can anyone offer an updated solution please ?

more options

I solved with this code:

#tabbrowser-tabs .tabbrowser-tab:only-of-type,
tab[first-visible-tab=true][last-visible-tab=true],
tab[first-visible-tab=true][last-visible-tab=true] + #tabbrowser-arrowscrollbox-periphery { 
  visibility: collapse !important; }
#tabbrowser-tabs, 
#tabbrowser-arrowscrollbox {
  min-height: 0 !important; }

Được chỉnh sửa bởi cor-el vào

more options

Giải pháp được chọn

This code would probably be better as in 110 support for first-visible-tab and last-visible-tab is removed (#1808661).

/* Hide Tab bar with only one Tab - [110] */
#tabbrowser-tabs .tabbrowser-tab:only-of-type,
#tabbrowser-tabs .tabbrowser-tab:only-of-type + #tabbrowser-arrowscrollbox-periphery{
  display:none !important;
}
#tabbrowser-tabs, #tabbrowser-arrowscrollbox {min-height:0!important;}
/* #TabsToolbar:not(:hover) */ #alltabs-button {display:none !important;}

Được chỉnh sửa bởi cor-el vào

more options

Thanks Iceberg, your solution worked for me.

more options

Iceberg's solution worked for me, thanks.

more options

If both solutions work, what makes one "better"? Shorter? Faster? More durable for the future? Just trying to understand and learn a little.

more options

The cor-el code is better. As first-visible-tab and last-visible-tab were removed from version 110 of Firefox. There is only first-visible-unpinned-tab. I don't know if it is better display: none or visibility:collapse. They seem to work both well.