实时调试

火狐浏览器给用户开放了浏览器窗口样式调试的方法,可以像调试网页那样调试窗口样式

在 Win/Linux 上按 Ctrl + Shift + I 或在 Mac 上按 Cmd + Opt + I image.png

image.png

火狐隐藏工具栏

导航栏输入about:config
将toolkit.legacyUserProfileCustomizations.stylesheets更改为 true

导航栏输入about:profiles

image.png

打开文件夹

  1. 创建 chrome 文件夹
  2. 新建 userChrome.css 文件,(用记事本改成css文件即可)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/hide_tabs_toolbar.css made available under Mozilla Public License v. 2.0
See the above repository for updates as well as full license text. */

/* Hides tabs toolbar */

/* For OSX use hide_tabs_toolbar_osx.css instead */

/* Note, if you have either native titlebar or menubar enabled, then you don't really need this style.
 * In those cases you can just use: #TabsToolbar{ visibility: collapse !important }
 */
 
/* IMPORTANT */
/*
Get window_control_placeholder_support.css
Window controls will be all wrong without it
*/


:root[tabsintitlebar] {
  --uc-toolbar-height: 40px;
}

:root[tabsintitlebar][uidensity="compact"] {
  --uc-toolbar-height: 32px
}

#TabsToolbar {
  visibility: collapse !important
}

:root[sizemode="fullscreen"] #TabsToolbar> :is(#window-controls, .titlebar-buttonbox-container) {
  visibility: visible !important;
  z-index: 2;
 }

:root:not([inFullscreen]) #nav-bar {
  margin-top: calc(0px - var(--uc-toolbar-height, 0px));
}

:root[tabsintitlebar] #toolbar-menubar[autohide="true"] {
  min-height: unset !important;
  height: var(--uc-toolbar-height, 0px) !important;
  position: relative;
}

#toolbar-menubar[autohide="false"] {
  margin-bottom: var(--uc-toolbar-height, 0px)
}

:root[tabsintitlebar] #toolbar-menubar[autohide="true"] #main-menubar {
  flex-grow: 0;
  align-items: stretch;
  background-color: var(--toolbar-bgcolor, --toolbar-non-lwt-bgcolor);
  background-clip: padding-box;
  border-right: 30px solid transparent;
  border-image: linear-gradient(to left, transparent, var(--toolbar-bgcolor, --toolbar-non-lwt-bgcolor) 30px) 20 / 30px

}

#toolbar-menubar:not([inactive]) {
  z-index: 2
}

#toolbar-menubar[autohide="true"][inactive]>#menubar-items {
  opacity: 0;
  pointer-events: none;
  margin-left: var(--uc-window-drag-space-pre, 0px)
}

#nav-bar {
  margin-right: 138px;
}

.titlebar-buttonbox-container {
  background: #fff;
}

/* 增加 窗口缩小时,需要空白进行拖动 */
#nav-bar-customization-target {
  margin-left: 1.2rem;
}

/* 增加 窗口缩小时,需要空白进行拖动 */
.titlebar-buttonbox-container {
  margin-right: 1.2rem;
}