Firefox in an “app mode”

firefoxkeyboard shortcuts

I would like to have a configuration of firefox to fake an "app mode". More precisely, I would like to have no navbar and disable the keyboard shortcuts like Ctrl-L, Ctrl-Q, etc …

I am running firefox in the i3wm and it automatically starts in full screen using i3 configuration trick:

exec_always --no-startup-id i3-msg 'workspace 1; exec script.sh'
for_window [class=".*"] fullscreen enable

The script opens firefox with /usr/bin/firefox -new-instance url

But the user should not be able to change url or add a tab with Ctrl-T. So is it possible to disable the navbar (like the bookmark bar) and disable the shortcuts. That would put firefox in a sort of "app mode" where navigation would be controlled by the buttons available on the web page only! Is there a way?

Plus, upon deployment of the webapp, I would like to have those settings ready. How can I store the configuration and replicate it on the deployed machine?

Best Answer

Using the userChrome.css, one can remove the nav-bar and the tab-bar with the following code:

#nav-bar {
    display: none !important;
}

#TabsToolbar {
  visibility: collapse !important;
}

This nevertheless does not disable the keyboard shortcuts, and in particular when one presses Ctrl-T it creates a new tab in which one cannot set a url since the navbar is not available.

Here is a useful link for some tweaks to be found!

Related Question