关于自动隐藏标签栏

阅读:1450回复:7
2024-05-19 10:52
写私信
楼主#
以前版本有个 browser.tabs.autoHide 当仅有一个标签时自动隐藏标签栏,请教现在该怎么实现?
My Technical Blog: http://art-technical.blogspot.com/
2024-05-19 11:27
写私信
1楼#
现在支持:has属性用css就可以实现了,忘记哪个版本开始支持的我用的126测试的。
#TabsToolbar:has(.tabbrowser-tab:only-of-type) {
    visibility: collapse !important;
}
2024-05-19 13:22
写私信
2楼#
alanfly:现在支持:has属性用css就可以实现了,忘记哪个版本开始支持的我用的126测试的。
#TabsToolbar:has(.tabbrowser-tab:only-of-type) {
    visibility: collapse !...
回到原帖
我用的127版,测试没效果不清楚哪的问题
@-moz-document url("chrome://browser/content/browser.xul")
url("chrome://browser/content/browser.xhtml") {
    #TabsToolbar:has(.tabbrowser-tab:only-of-type) {
        visibility: collapse !important;
    }
}
My Technical Blog: http://art-technical.blogspot.com/
2024-05-19 14:12
写私信
3楼#
前缀格式错了,俩url之间应该有逗号分隔,而且新版应该用browser.xhtml就够了,xul是老版本的。
@-moz-document url("chrome://browser/content/browser.xhtml") {
    #TabsToolbar:has(.tabbrowser-tab:only-of-type) {
        visibility: collapse !important;
    }
}
2024-05-19 17:26
写私信
4楼#
alanfly:前缀格式错了,俩url之间应该有逗号分隔,而且新版应该用browser.xhtml就够了,xul是老版本的。
@-moz-document url("chrome://browser/content/browser.xhtml") {

...
回到原帖
大佬专业, 又发现错误了,少了这步.

Create a new folder named chrome
经测试发现127正常实现,115esr不行

@-moz-document url("chrome://browser/content/browser.xhtml") {    #TabsToolbar:has(.tabbrowser-tab:only-of-type) {
        visibility: collapse !important;
    }
}
My Technical Blog: http://art-technical.blogspot.com/
2024-05-19 19:47
写私信
5楼#
:has是121版里正式支持的。之前的版本里到about:config里有个开关layout.css.has-selector.enabled可以打开,但功能不全。你这种用法只在115版里也只是部分支持,我在装了115esr的win7上测试,虽然能生效但无法即时生效,要调整窗口尺寸才行
2024-05-20 07:52
写私信
6楼#
taoww::has是121版里正式支持的。之前的版本里到about:config里有个开关layout.css.has-selector.enabled可以打开,但功能不全。你这种用法只在115版里也只是部分支持,我在装了115esr的win7上测试...回到原帖
layout.css.has-selector.enabled可以打开后,esr版效果真不好,暂时放弃了。感谢分享
My Technical Blog: http://art-technical.blogspot.com/
2024-09-18 19:55
写私信
7楼#
https://github.com/MrOtherGuy/firefox-csshacks/blob/master/chrome/autohide_toolbox.css
这里挺全的,右侧一大堆,你可以找找看,有没有喜欢的。
有功夫就自己仿造一个