infinity
狐狸大王
狐狸大王
  • UID48261
  • 注册日期2014-12-18
  • 最后登录2023-03-15
  • 发帖数352
  • 经验350枚
  • 威望0点
  • 贡献值96点
  • 好评度34点
  • 社区居民
  • 忠实会员
阅读:970回复:5

如何把书签挪到这个列表的最上方?

楼主#
更多 发布于:2019-09-04 17:25
如题,现在是搜索预测在最上方,我得按好多下tab才能切换到书签上,尝试写了下css发现-moz-box-ordinal-group不管用,只有颜色生效了……

infinity
狐狸大王
狐狸大王
  • UID48261
  • 注册日期2014-12-18
  • 最后登录2023-03-15
  • 发帖数352
  • 经验350枚
  • 威望0点
  • 贡献值96点
  • 好评度34点
  • 社区居民
  • 忠实会员
1楼#
发布于:2019-09-04 18:58
用这个样式看起来是对了,但是按下tab的切换顺序还是错的
#urlbarView-results {
    display: -moz-box !important;
    -moz-box-orient: vertical !important;
}
#urlbarView-results > div[type="switchtab"] {
    -moz-box-ordinal-group: 0 !important;
    color: orange !important;
}
#urlbarView-results > div[type="bookmark"] {
    -moz-box-ordinal-group: 1 !important;
    color: green !important;
}
#urlbarView-results > div:not([type]) {
    -moz-box-ordinal-group: 2 !important;
    color: red !important;
}
#urlbarView-results > div[type="search"] {
    -moz-box-ordinal-group: 3 !important;
    color: purple !important;
}
infinity
狐狸大王
狐狸大王
  • UID48261
  • 注册日期2014-12-18
  • 最后登录2023-03-15
  • 发帖数352
  • 经验350枚
  • 威望0点
  • 贡献值96点
  • 好评度34点
  • 社区居民
  • 忠实会员
2楼#
发布于:2019-09-04 20:18
想了下,tab切换这个似乎没戏啊
lonely_8
非常火狐
非常火狐
  • UID30273
  • 注册日期2009-09-03
  • 最后登录2022-08-09
  • 发帖数733
  • 经验469枚
  • 威望0点
  • 贡献值86点
  • 好评度147点
  • 社区居民
  • 忠实会员
3楼#
发布于:2019-09-04 21:14
-moz-box-ordinal-group 没有改变真实的 DOM 节点顺序,所以 CSS 没办法的。
可以用 UC 脚本处理一下。只适用于 Quantumbar
location.href == 'chrome://browser/content/browser.xhtml' && (() => {
  //排列顺序
  const order = [
    '[type="switchtab"]',
    '[type="bookmark"]',
    ':not([type])',
    '[type="search"]'
  ];
  const { UrlbarView } = ChromeUtils.import('resource:///modules/UrlbarView.jsm');
  const _updateIndices = UrlbarView.prototype._updateIndices;
  UrlbarView.prototype._updateIndices = function () {
    const fragment = document.createDocumentFragment();
    for(const selector of order){
        const childs = this._rows.querySelectorAll(`:scope > div${selector}`);
        fragment.append(...childs);
    }
    this._rows.prepend(fragment);
    _updateIndices.call(this);
  }
})();
infinity
狐狸大王
狐狸大王
  • UID48261
  • 注册日期2014-12-18
  • 最后登录2023-03-15
  • 发帖数352
  • 经验350枚
  • 威望0点
  • 贡献值96点
  • 好评度34点
  • 社区居民
  • 忠实会员
4楼#
发布于:2019-09-05 00:15
lonely_8:-moz-box-ordinal-group 没有改变真实的 DOM 节点顺序,所以 CSS 没办法的。
可以用 UC 脚本处理一下。只适用于 Quantumbar
location.href == 'chrome://browser/...
回到原帖
感谢!没用UC,只能放弃了
infinity
狐狸大王
狐狸大王
  • UID48261
  • 注册日期2014-12-18
  • 最后登录2023-03-15
  • 发帖数352
  • 经验350枚
  • 威望0点
  • 贡献值96点
  • 好评度34点
  • 社区居民
  • 忠实会员
5楼#
发布于:2019-09-25 16:37
真是搞笑了,忘了火狐的设置里就有这一项…… 取消掉这个,书签也会提前,NICE!
游客

返回顶部