firefox的查找栏位置如何调整?【已经解决】
本帖最后由 [皆神孝介] 于 2024-2-13 09:29 编辑就是按下 ctrl+F 出现的那个“在此页面中查找”,默认出现在网页底部,希望能移动到网页顶部,有没有设置的办法呢?
本帖最后由 screeper 于 2024-2-13 04:18 编辑
可以参考firefox-csshacks项目,里面有很多别人写好的userchrome,楼主的要求也可以在里面找到
floating_findbar_on_top.css
/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/floating_findbar_on_top.css made available under Mozilla Public License v. 2.0
See the above repository for updates as well as full license text. */
/* This style makes findbar appear as floating box at the top-left of the content area.
* If you want the findbar on right side instead then create a new pref
* userchrome.floating-findbar-on-right.enabled and set it to true and restart Firefox
*
* Note that privacy.resistFingerprinting.letterboxing prevents this from working properly
*/
findbar{
order: -1;
margin-bottom: -33px;
position: relative;
border-top: none !important;
padding: 0 !important;
transition: transform 82ms linear, opacity 82ms linear 32ms !important;
background: none !important;
pointer-events: none;
z-index: 1;
white-space: nowrap;
}
.findbar-container > .findbar-find-fast{
padding: var(--toolbarbutton-inner-padding) 1px;
margin: 0 !important;
}
findbar{ transform: translateY(-30px);}
findbar > .findbar-container,
findbar > .close-icon{
border: 1px solid var(--chrome-content-separator-color);
border-width: 0 0 1px 0px;
background-color: var(--lwt-accent-color) !important;
background-image: linear-gradient(var(--toolbar-bgcolor),var(--toolbar-bgcolor)),var(--lwt-header-image,none);
pointer-events: auto;
}
findbar > .findbar-container{
border-bottom-right-radius: 4px;
border-right-width: 1px;
height: initial !important;
margin-inline: 0px !important;
overflow-inline: visible !important;
}
.findbar-find-status{
display: flex;
overflow: hidden;
text-overflow: ellipsis;
flex-grow: 1;
}
.findbar-closebutton{
margin: 0 !important;
border-radius: 0 !important;
padding: 5px !important;
width: initial !important;
order: -1;
}
.findbar-closebutton > image{ padding: 3px }
.findbar-closebutton:hover > image{
background: var(--toolbarbutton-hover-background) !important;
border-radius: 4px
}
findbar > .findbar-container > hbox{ margin: 0 5px }
findbar::after{
content:"";
display: flex;
flex-grow: 100;
}
@media (-moz-bool-pref: "userchrome.floating-findbar-on-right.enabled"){
findbar{
flex-direction: row-reverse;
}
findbar > .findbar-container{
flex-direction: row-reverse;
border-inline-width: 1px 0px;
border-bottom-right-radius: 0px;
border-bottom-left-radius: 4px;
}
/*
Move findbar so it isn't over the scrollbar
Delete if you want findbar to begin from right window edge
*/
findbar{
margin-right: 16px;
border-right: 1px solid var(--chrome-content-separator-color);
}
}
@supports -moz-bool-pref("userchrome.floating-findbar-on-right.enabled"){
findbar{
flex-direction: row-reverse;
}
findbar > .findbar-container{
flex-direction: row-reverse;
border-inline-width: 1px 0px;
border-bottom-right-radius: 0px;
border-bottom-left-radius: 4px;
}
/*
Move findbar so it isn't over the scrollbar
Delete if you want findbar to begin from right window edge
*/
findbar{
margin-right: 16px;
border-right: 1px solid var(--chrome-content-separator-color);
}
}
使用方法:
1. 在about:config中将toolkit.legacyUserProfileCustomizations.stylesheets设置为true
2. 菜单>帮助>更多排障信息>配置文件夹>打开文件夹
3. 在打开的文件夹内新建名为chrome的文件夹(如果没有)
4. 在chrome文件夹内新建名为userChrome.css的文件(如果没有)
5. 用文本编辑器打开userChrome.css,复制粘贴以上代码之后保存,重启浏览器就能看到效果
效果是这样的:
https://p.sda1.dev/15/5f5a4b7568db2b019c2296b370bc022f/PixPin_2024-02-13_04-11-13.jpg
如果想要出现在右边的话,在about:config里新建一个叫userchrome.floating-findbar-on-right.enabled的项目,然后设置成true即可
https://p.sda1.dev/15/782f03256e96235166e724e3f548009c/PixPin_2024-02-13_04-11-58.jpg
页:
[1]