How to force to restart firefox in a clean way?

Update:
Now it is possible to do it directly in the url bar, asking for the special page about:restartrequired

about:restartrequired

It opens a page with a button to restart firefox that should preserve pages, tabs and windows.

enter image description here

Fast Internal answer:
Press ShiftF2, write restart in the opened bar, then press enter.
On old versions, e.g. the 41.0.2, it was needed to write the word true too: restart true.

Some words more:
It's possible to force Firefox to restart through the Developer Toolbar, usually accessible via ShiftF2 or via menu (Firefox/Tools >> Web Developer >> Developer Toolbar in the English version).

A bar will be opened in the bottom of the page where it will be possible to write the command

restart

It is possible to use restart --nocache true or restart --nocache false in order to force it the refresh of the tabs content or to use the local cached instead.
In a similar way it is possible to force the safe mode upon restart.

Synopsis: restart [--nocache] [--safemode]

Restart Firefox

Options:

[--nocache] (boolean, required)
Disables loading content from cache upon restart
[--safemode] (boolean, required)
Enables Safe Mode upon restart
  • It works on Firefox 45.0.2. For the old synopsis check in the history of this answer.

An alternative way; pick a firefox Add on:
Another option was to pick one of the many add-ons available for Firefox from the add-on page, such as Restart Button, or Restart... that can add a button or a line in the the menu. However these examples are not compatible with Firefox 57 or later.


In Firefox 62, the browser CLI (ShiftF2) was removed (change tracker, release notes). I found two ways to restart Firefox 62 or newer:

Using about:profiles

  1. Navigate to about:profiles in the URL bar.
  2. At the top-right corner of the page, click Restart normally....

Keyboard shortcut in browser console

  1. Press CtrlShiftJ (or CmdShiftJ on Mac) to open the Browser Console.
  2. Press CtrlAltR (or CmdAltR on Mac) to restart the browser.