Stage1st

 找回密码
 立即注册
搜索
查看: 1477|回复: 0
打印 上一主题 下一主题

[软件] firefox的查找栏位置如何调整?【已经解决】

[复制链接]
     
跳转到指定楼层
楼主
发表于 2024-2-12 23:05 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 [皆神孝介] 于 2024-2-13 09:29 编辑

就是按下 ctrl+F 出现的那个“在此页面中查找”,默认出现在网页底部,希望能移动到网页顶部,有没有设置的办法呢?
回复

使用道具 举报

2#
发表于 2024-2-13 00:50 | 只看该作者
以前的话,改omni,或者改userchrome,要查出xul中的div名
回复

使用道具 举报

3#
发表于 2024-2-13 04:15 | 只看该作者
本帖最后由 screeper 于 2024-2-13 04:18 编辑

可以参考firefox-csshacks项目,里面有很多别人写好的userchrome,楼主的要求也可以在里面找到

floating_findbar_on_top.css
  1. /* 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
  2. See the above repository for updates as well as full license text. */

  3. /* This style makes findbar appear as floating box at the top-left of the content area.
  4. * If you want the findbar on right side instead then create a new pref
  5. * userchrome.floating-findbar-on-right.enabled and set it to true and restart Firefox
  6. *
  7. * Note that privacy.resistFingerprinting.letterboxing prevents this from working properly
  8. */

  9. findbar{
  10.   order: -1;
  11.   margin-bottom: -33px;
  12.   position: relative;
  13.   border-top: none !important;
  14.   padding: 0 !important;
  15.   transition: transform 82ms linear, opacity 82ms linear 32ms !important;
  16.   background: none !important;
  17.   pointer-events: none;
  18.   z-index: 1;
  19.   white-space: nowrap;
  20. }

  21. .findbar-container > .findbar-find-fast{
  22.   padding: var(--toolbarbutton-inner-padding) 1px;
  23.   margin: 0 !important;
  24. }

  25. findbar[hidden]{ transform: translateY(-30px);}

  26. findbar > .findbar-container,
  27. findbar > .close-icon{
  28.   border: 1px solid var(--chrome-content-separator-color);
  29.   border-width: 0 0 1px 0px;
  30.   background-color: var(--lwt-accent-color) !important;
  31.   background-image: linear-gradient(var(--toolbar-bgcolor),var(--toolbar-bgcolor)),var(--lwt-header-image,none);
  32.   pointer-events: auto;
  33. }

  34. findbar > .findbar-container{
  35.   border-bottom-right-radius: 4px;
  36.   border-right-width: 1px;
  37.   height: initial !important;
  38.   margin-inline: 0px !important;
  39.   overflow-inline: visible !important;
  40. }

  41. .findbar-find-status{
  42.   display: flex;
  43.   overflow: hidden;
  44.   text-overflow: ellipsis;
  45.   flex-grow: 1;
  46. }

  47. .findbar-closebutton{
  48.   margin: 0 !important;
  49.   border-radius: 0 !important;
  50.   padding: 5px !important;
  51.   width: initial !important;
  52.   order: -1;
  53. }
  54. .findbar-closebutton > image{ padding: 3px }
  55. .findbar-closebutton:hover > image{
  56.   background: var(--toolbarbutton-hover-background) !important;
  57.   border-radius: 4px
  58. }
  59. findbar > .findbar-container > hbox{ margin: 0 5px }

  60. findbar::after{
  61.   content:"";
  62.   display: flex;
  63.   flex-grow: 100;
  64. }

  65. @media (-moz-bool-pref: "userchrome.floating-findbar-on-right.enabled"){
  66.   findbar{
  67.     flex-direction: row-reverse;
  68.   }
  69.   findbar > .findbar-container{
  70.     flex-direction: row-reverse;
  71.     border-inline-width: 1px 0px;
  72.     border-bottom-right-radius: 0px;
  73.     border-bottom-left-radius: 4px;
  74.   }
  75.   /*
  76.   Move findbar so it isn't over the scrollbar
  77.   Delete if you want findbar to begin from right window edge
  78.   */
  79.   findbar{
  80.     margin-right: 16px;
  81.     border-right: 1px solid var(--chrome-content-separator-color);
  82.   }
  83. }

  84. @supports -moz-bool-pref("userchrome.floating-findbar-on-right.enabled"){
  85.   findbar{
  86.     flex-direction: row-reverse;
  87.   }
  88.   findbar > .findbar-container{
  89.     flex-direction: row-reverse;
  90.     border-inline-width: 1px 0px;
  91.     border-bottom-right-radius: 0px;
  92.     border-bottom-left-radius: 4px;
  93.   }
  94.   /*
  95.   Move findbar so it isn't over the scrollbar
  96.   Delete if you want findbar to begin from right window edge
  97.   */
  98.   findbar{
  99.     margin-right: 16px;
  100.     border-right: 1px solid var(--chrome-content-separator-color);
  101.   }
  102. }
复制代码


使用方法:
1. 在about:config中将toolkit.legacyUserProfileCustomizations.stylesheets设置为true
2. 菜单>帮助>更多排障信息>配置文件夹>打开文件夹
3. 在打开的文件夹内新建名为chrome的文件夹(如果没有)
4. 在chrome文件夹内新建名为userChrome.css的文件(如果没有)
5. 用文本编辑器打开userChrome.css,复制粘贴以上代码之后保存,重启浏览器就能看到效果

效果是这样的:

如果想要出现在右边的话,在about:config里新建一个叫userchrome.floating-findbar-on-right.enabled的项目,然后设置成true即可

评分

参与人数 1战斗力 +2 收起 理由
[皆神孝介] + 2 有用,谢谢。

查看全部评分

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|Archiver|上海互联网违法和不良信息举报中心|网上有害信息举报专区|962110 反电信诈骗|举报电话 021-62035905|stage1st 沪ICP备13020230号-1 沪公网安备 31010702007642号

GMT+8, 2024-4-28 21:21 , Processed in 0.021030 second(s), 8 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表