I solved this by using Automator to create an Application that makes use of an Action > Utilities > Run Shell Script
:
open -a Firefox
sleep 1
lsappinfo setinfo -app Firefox ApplicationType=UIElement
osascript -e 'tell application "System Events" to tell process "Firefox" to set value of attribute "AXFullScreen" of first window to true'
sleep 0.5
for f in "$@"; do open -a Firefox "$f"; done
I set the shell script Shell:
to /bin/sh
and Pass input:
to as arguments
, save it as "Firefox Full Screen" in /Applications
, change its icon as explained here and add it as an exception in System Preferences > Security & Privacy > Privacy Tab > Accessibility
.
I then can click the application icon or run any of the following and it works:
open -a "Firefox Full Screen"
open -a "Firefox Full Screen" --args "https://google.com"
open -a "Firefox Full Screen" --args "https://google.com" "https://twitter.com"
I'm using this coupled with the following userChrome.css
to both evade a well known issue with the macOS menu bar on full screen applications and another long standing address bar and tab auto-hide bug that Firefox have with macOS native full screen.
userChrome.css
#navigator-toolbox[inFullscreen] {
position: relative;
z-index: 1;
height: 3px;
margin-bottom: -3px;
opacity: 0;
overflow: hidden;
}
#navigator-toolbox[inFullscreen]:hover {
height: auto;
margin-bottom: 0px;
opacity: 1;
overflow: show;
}
#content-deck[inFullscreen]{
position:relative;
z-index: 0;
}
For a generic approach, check my other answer.
TIP
- Firefox, by default, does not have any issue on Linux or Windows to auto-hide address bar and tabs in full screen as expected. With that said, I grabbed this
userChrome.css
from my ArchLinux setup. I use it on i3 and sway tiling window managers, with all the [inFullscreen]
removed, to get address bar and tabs to auto-hide in normal bordless windows.