[BUG] Entering fullscreen mode does not hide any browser UI elements
What happened?
When I enter fullscreen mode, both native to firefox and tab bar remain visible indefinitely.
This occurs only on Zen Browser in Wayland KDE on Arch Linux. This can not be reproduced on stable, nor on nightly versions of Firefox.
This has no effect on the problem:
- Setting or unsetting
browser.fullscreen.autohideinabout:config - Forcing start in XWayland mode by setting
GDK_BACKEND=x11 - Using different methods to enter fullscreen (
F11key, Toolbar button, KWin action) - Enabling/Disabling native titlebar
- Clean re-install
Only way to hide elements is to activate Zen Compact mode manually after entering fullscreen.
Reproducible?
- [X] I have checked that this issue cannot be reproduced on Mozilla Firefox.
Version
Mozilla Zen 1.0.0-a.28
Severity impact
Medium
What platform are you seeing the problem on?
Linux
Relevant log output
No messages are being emitted to Ctrl-Shift-G console, except for tab height message.
persists on a.29
I have digged around a little and I believe I found the issue. It was likely introduced in commit 43460815ac94, in (no longer existing) src/browser/themes/shared/zen-browser-shared.css file.
Full-screen CSS pseudo-class detectors all over the code-base have a condition to trigger on "inDOMFullscreen"; this is not perfect, because entering full-screen by any other reason from web page explicitly requesting it will NOT trigger this condition. This is not a well-documented behavior, in fact, this is the only reference I can find is on Reddit: https://www.reddit.com/r/FirefoxCSS/comments/kxfka8/how_to_style_fullscreen_only/
That also means that sites with media players like youtube and twitch do let you work around this bug – if and only if you manually click on a "make fullscreen" button ~like a caveman~, all toolbars disappear, as expected.
Note that this behavior contrasts with upstream Firefox implementation:
https://github.com/mozilla/gecko-dev/blob/3f193a8bb0759058c2f9a9d7761ad73bc6ffd4b1/browser/fxr/content/fxrui.css#L134
If this is a design decision, it should be reconsidered, as it is different from the upstream in a UX breaking way, and really not what people expect of browsers nowadays (all of Firefox, Chromium derivatives and Safary will hide UI elements on F11 keypress). Personally, I find it also very un-Zen-like.
Replacing occurences of "inDOMFullscreen" with it's superset "inFullscreen" should be a clean fix.
I have not tested the build with the change myself just yet, but I will try to next week. In the meantime, custom userChrome.css overriding current behavior could be a good workaround.
My initial assumption was wrong. inDOMFullscreen everywhere is in the right place. Instead, new behavior should be added to the elements that mirrors behavior of panels in compact mode.
In the meantime, I made a hacky workaround to just forcefully (and uninteractively) hide all panels if fullscreen is detected.
Okay, I think I have a better idea now.
The way upstream Firefox implements hiding panels and showing them on hover is not through CSS.
- First, the
#navbar-toolboxelement is located using DOM selectors on UI: https://github.com/mozilla/gecko-dev/blob/45d6f8bf028e049f812aa26dced565d50068af5d/browser/base/content/browser.js#L358 - Then, the toolbar is hidden by manually setting negative
margin-topstyle property: https://github.com/mozilla/gecko-dev/blob/45d6f8bf028e049f812aa26dced565d50068af5d/browser/base/content/browser-fullScreenAndPointerLock.js#L936 - This gets overriden by ZenBrowser, because here
#navbar-toolboxis split into vertical tab strip and navigation bar at the top, so the upstream behavior does not make sense anymore: https://github.com/zen-browser/desktop/blob/81a2b5b874a9c44ee089ad9c88cfa7a636269fe5/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css#L12 - The actual navigation bar,
#nav-bar, does not have any logic associated with it for fullscreen, as upstream expects it to be positioned inside the#navbar-toolbox.
As a result:
#navbar-toolbox, aka tab bar at the left does not disappear anywhere, because it is!importantnot to;#nav-bar, aka navigation bar at the top does not disappear anywhere, because it was never expected to.
The code to implement the fix would be straightforward – one would just have to adapt Mozilla code intended for gNavBox to instead operate on #nav-bar, and re-write it with minor modifications to operate on vertical #navbar-toolbox, but it is not a one-evening project for me. So I will just stick to using the hack from the previous comment in the meantime.
Alternatively: the code to implement the exactly correct behavior is already there, written to work for the Compact Mode. Reapplied to [sizemode="fullscreen"], it could fix all our problems.
While the #1026 awaits review, all affected users may use this userChrome.css to work around this issue (it contains the same code as in PR, just as a userChrome file) and/or test the applied fix:
/* Hide all toolbars in borderless fullscreen mode not initiated by the DOM */
:root[sizemode="fullscreen"] {
& #navigator-toolbox {
--zen-compact-toolbox-margin-single: 15px;
--zen-compact-toolbox-margin: var(--zen-compact-toolbox-margin-single);
position: absolute;
display: block;
transition: 200ms ease-in-out !important;
transform: translateX(calc(-100% + (var(--zen-compact-toolbox-margin-single) / 2)));
opacity: 0;
line-height: 0;
z-index: 1;
height: 100%;
margin: 0;
padding: var(--zen-compact-toolbox-margin) !important;
& #titlebar {
border: 1px solid var(--zen-colors-border);
transition-delay: 200ms;
background: var(--zen-colors-tertiary) !important;
padding: 0 5px;
border-radius: var(--zen-panel-radius);
}
&>* {
pointer-events: none;
}
&,
& #titlebar {
min-width: calc(var(--zen-navigation-toolbar-min-width) + var(--zen-compact-toolbox-margin-single) * 4) !important;
}
}
& #navigator-toolbox:hover,
& #navigator-toolbox:focus-within,
& #navigator-toolbox[zen-user-show],
& #mainPopupSet:has(> #appMenu-popup:hover)~toolbox,
& #navigator-toolbox:has(*[open="true"]:not(tab):not(#zen-sidepanel-button)) {
transform: none !important;
opacity: 1;
&>* {
pointer-events: all;
}
}
& #navigator-toolbox>* {
line-height: normal;
}
& #navigator-toolbox,
& #navigator-toolbox>* {
-moz-appearance: none !important;
}
& #zen-appcontent-navbar-container {
--urlbar-height: unset;
transition: .2s ease-in-out;
transform: translateY(calc(-100% + 5px));
opacity: 0;
position: absolute;
width: 100%;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
border-bottom: 1px solid var(--zen-colors-border);
top: 0;
background: var(--zen-colors-tertiary);
z-index: 2;
transition: .2s ease-in-out;
}
& #zen-appcontent-navbar-container:hover,
& #zen-appcontent-navbar-container:focus-within,
& #zen-appcontent-navbar-container[zen-user-show],
& #mainPopupSet:has(> #appMenu-popup:hover)~#zen-appcontent-navbar-container,
& #zen-appcontent-navbar-container:has(*[open="true"]) {
transform: translateY(0);
opacity: 1;
}
& #titlebar {
padding-top: 5px !important;
}
& #zen-sidebar-web-panel-wrapper {
margin-top: 10px !important;
}
}
/* Support for vertical tabs on the right side */
@media (-moz-bool-pref: "zen.tabs.vertical.right-side") {
:root[sizemode="fullscreen"] {
& #navigator-toolbox {
right: 0 !important;
transform: translateX(calc(100% - (var(--zen-compact-toolbox-margin-single) / 2))) !important;
;
}
}
& #navigator-toolbox:hover,
& #navigator-toolbox:focus-within,
& #navigator-toolbox[zen-user-show],
& #mainPopupSet:has(> #appMenu-popup:hover)~toolbox,
& #navigator-toolbox:has(*[open="true"]:not(tab):not(#zen-sidepanel-button)) {
transform: none !important;
opacity: 1;
&>* {
pointer-events: all;
}
}
}
Hi, @ekorchmar. I'm Dosu, and I'm helping the desktop team manage their backlog. I'm marking this issue as stale.
Issue Summary:
- The issue involves Zen Browser on Wayland KDE in Arch Linux not hiding UI elements in fullscreen mode.
- Initially thought to be related to the "inDOMFullscreen" condition.
- You proposed a workaround using
userChrome.cssand submitted a pull request (#1026). - The proposed fix has received positive feedback from other users.
Next Steps:
- Please confirm if this issue is still relevant to the latest version of the desktop repository. If so, you can keep the discussion open by commenting here.
- Otherwise, this issue will be automatically closed in 7 days.
Thank you for your understanding and contribution!
The issue involves Zen Browser on Wayland KDE in Arch Linux not hiding UI elements in fullscreen mode.
The issue is not limited to any OS or desktop environment. It affects all desktop environments as a clear regression from Firefox.
The proposed fix has received positive feedback from other users. And was closed without explanation.
Please confirm if this issue is still relevant to the latest version of the desktop repository. Indeed it is.
@mauro-balades, the user @ekorchmar has confirmed that the issue regarding Zen Browser not hiding UI elements in fullscreen mode is still relevant and affects all desktop environments. Could you please assist them with this issue?
this is intended. use compact mode to get rid of UI ellements
Shouldn't there maybe be a setting to "Hide UI when fullscreening" or "Automatically enable compact mode when fullscreening"? I'm pretty sure many users (me included) would prefer that over having to manually en-/disable compact mode everytimes we want to (un-)fullscreen a page.
compact mode does not get rid of UI elements. the border remains on screen. true fullscreen F11 should remove the UI including the border, and leave only the page contents, like every other browser.
Asking for a reopen ^^
Asking for a reopen ^^
I ask that too. Currently, pressing F11 only maximizes the window and removes the contents from the bookmarks bar, but the page doesn't get larger than when the window is maximized the normal way.
Yeah, it should be reopen. It annoys a little when in full screen. I have no problem with compact mode border on window mode, I actually likes it, but in full screen there shouldn't be any.
Asking for reopen. The issue still persists and the userChrome CSS hack posted by @ekorchmar doesn't seem to be working either in the latest stable release 1.14.11b as of Aug 25, 2025.
I really don't like that the only thing that happens when I press F11 is that the contents of the bookmarks toolbar disappear, without the size of the page changing. Pressing F11 should IMHO act like
window.addEventListener('keydown', (evt) => {
if (!evt.defaultPrevented && !document.fullscreen && evt.key==='F11') {
evt.preventDefault();
document.documentElement.requestFullscreen();
}
});
I have created a UserScript on GreasyFork with the above code, for anyone interested: https://greasyfork.org/sv/scripts/547277-zen-fullscreen-polyfill
@Lampe2020 Thanks a lot for this script. First I tried it in Tampermonkey and it didn't work, but then I tried it in Greasemonkey where it did work. It does the job of what it says, completely immersive fullscreen without any borders. But there's one problem: the compact mode doesn't work in such fullscreen, i.e., the sidebar and toolbar don't come out when the cursor is hovered near the edges, which they do in normal fullscreen without this script (which unfortunately comes with borders). Nonetheless, this script is indeed handy for use cases where I wouldn't need the toolbar/sidebar. However, an ideal solution where this works without compromising on the compact mode utility of having the toolbar/sidebar get triggered and activated is awaited.
Thanks for this.
Edit: Now while using this further, I discovered another drawback. Whenever the page gets changed, it exits the fullscreen. For example, if I am browsing results on google.com and I click on a link, it will exit the fullscreen and gets back to windowed mode. So this really doesn't seem like an ideal solution, handy for specific use cases nonetheless.
First I tried it in Tampermonkey and it didn't work, but then I tried it in Greasemonkey where it did work.
I only tested it with Greasemonkey, although it is so simple that I have no clue why it doesn't work in Tampermonkey as well…
It does the job of what it says, completely immersive fullscreen without any borders. But there's one problem: the compact mode doesn't work in such fullscreen, i.e., the sidebar and toolbar don't come out when the cursor is hovered near the edges, which they do in normal fullscreen without this script (which unfortunately comes with borders).
User scripts can AFAIK not run in the chrome, only inside the webpage. I'd have to write an extention to accomplish that, and that's more effort, that I haven't had the time for yet. If I ever get around to that I can maybe post it here (will probably not be this week tho and may potentially never happen, depending on how busy I am).
Whenever the page gets changed, it exits the fullscreen. For example, if I am browsing results on google.com and I click on a link, it will exit the fullscreen and gets back to windowed mode. So this really doesn't seem like an ideal solution, handy for specific use cases nonetheless.
That's becase it essentially makes the page ask for fullscreen itself, so the fullscreening only applies for that single time you are on on that single page. Should be enough as a stop-gap solution for now tho, better than nothing.
@Lampe2020 thanks for the response. This is surely a stop-gap solution and probably enough for the time being for me. You shouldn't really have to dedicate yourself to making a solution for this unless it's for yourself. This is good enough for now, and hopefully it gets fixed in the browser at some point in the future. Thanks again.
@Lampe2020 I just found the perfect solution to my problem, thanks to a person on the zen discord server. Just add this to userChrome.css:
:root[sizemode="fullscreen"] {
--zen-element-separation: 0px !important;
--zen-webview-border-radius: 0px !important;
}
It always remains in fullscreen and the toolbar and sidebar also show up on hover.