keyboard shortcut to restart firefox? [Mac]

User Help for Mozilla Firefox
Negativeions
Posts: 244
Joined: September 17th, 2003, 12:07 pm

keyboard shortcut to restart firefox? [Mac]

Post by Negativeions »

Thanks.
User avatar
smsmith
Moderator
Posts: 19979
Joined: December 7th, 2004, 8:51 pm
Location: Indiana

Re: keyboard shortcut to restart firefox? [Mac]

Post by smsmith »

I don't believe there is a built in restart keyboard shortcut, but you can use this extension to do that:
https://addons.mozilla.org/en-US/firefo ... /re-start/

The extension may no longer work in Fx 57, though.
Give a man a fish, and he eats for a day. Teach a man to fish, and he eats for a lifetime.
I like poetry, long walks on the beach and poking dead things with a stick.
Please do not PM me for personal support. Keep posts here in the Forums instead and we all learn.
morat
Posts: 6403
Joined: February 3rd, 2009, 6:29 pm

Re: keyboard shortcut to restart firefox? [Mac]

Post by morat »

You can show a restart button in the Add-ons Manager with a css tweak in Fx 57.

Code: Select all

/* Firefox userContent.css */

@-moz-document url-prefix("chrome://mozapps/content/extensions/extensions.xul"), url-prefix("about:addons") {
  #updates-restart-btn {
    display: -moz-box !important;
  }
  #updates-restart-btn .button-icon {
    list-style-image: url("chrome://browser/skin/panic-panel/header-small.png") !important;
  }
  #updates-restart-btn .button-text {
    display: none !important;
  }
}
http://kb.mozillazine.org/UserContent.css

Edit:

The header-small.png image isn't available in Fx 58. (fix below)
Last edited by morat on November 20th, 2017, 11:25 pm, edited 1 time in total.
User avatar
dickvl
Posts: 54145
Joined: July 18th, 2005, 3:25 am

Re: keyboard shortcut to restart firefox? [Mac]

Post by dickvl »

I usually have the developer toolbar visible and type 'restart' (rest: autocomplete with the tab key) to restart.
Negativeions
Posts: 244
Joined: September 17th, 2003, 12:07 pm

Re: keyboard shortcut to restart firefox? [Mac]

Post by Negativeions »

Thanks.

Out of curiosity, what function does the restart button call? Is there any way to map that function to a hotkey in macOS preferences > Keyboard > Shortcuts?
morat
Posts: 6403
Joined: February 3rd, 2009, 6:29 pm

Re: keyboard shortcut to restart firefox? [Mac]

Post by morat »

The restart button calls an internal command that's only valid when the Add-ons Manger tab is selected.

Code: Select all

goDoCommand("cmd_restartApp");
Mac OS doesn't have access to internal commands.

I don't know how you would politely close a process on the Mac OS.

Windows OS
http://nircmd.nirsoft.net/closeprocess.html
http://nircmd.nirsoft.net/killprocess.html
User avatar
RobertJ
Moderator
Posts: 10880
Joined: October 15th, 2003, 7:40 pm
Location: Chicago IL/Oconomowoc WI

Re: keyboard shortcut to restart firefox? [Mac]

Post by RobertJ »

.
You could write a simple AppleScript to shut down FF and then restart it. You could then use Automator to assign that AppleScript to a keyboard shortcut. BEWARE: on Mac all keyboard shortcuts are global so what ever you select must be unique.

.
FF 92.0 - TB 78.13 - Mac OSX 10.13.6
Negativeions
Posts: 244
Joined: September 17th, 2003, 12:07 pm

Re: keyboard shortcut to restart firefox? [Mac]

Post by Negativeions »

morat: you can kill processes from terminal or activity monitor (which is sort of like task manager in Windows or whatever it's called)

RobertJ: oh ya, right. Forgot about that. Thanks.
Negativeions
Posts: 244
Joined: September 17th, 2003, 12:07 pm

Re: keyboard shortcut to restart firefox? [Mac]

Post by Negativeions »

check it, I made a stupid simple applescript app tell application "firefox" to quit, delay, tell application Firefox to open. I have BetterTouchTool, created a firefox specific shortcut to open the script app with cmd-shift-q. I mean... just. Great.
User avatar
dickvl
Posts: 54145
Joined: July 18th, 2005, 3:25 am

Re: keyboard shortcut to restart firefox? [Mac]

Post by dickvl »

Keep in mind that it can take unknown time for Firefox to close properly.
When you use builtin means to restart then it is known when Firefox has closed and Firefox is restarted properly in all cases and currently open tabs will reloaded (browser.sessionstore.resume_session_once = true).
If you use an external script then you would have to guess how long you need to wait before starting Firefox.
Otherwise you will get the alert dialog that Firefox is already running.
Negativeions
Posts: 244
Joined: September 17th, 2003, 12:07 pm

Re: keyboard shortcut to restart firefox? [Mac]

Post by Negativeions »

On macOS, I don't think that's a problem. I've never seen a "firefox is already running" msg, or any other app for that matter. If I do, I'll increase the delay but right now it's at 1 second with no problems whatsoever. But even if I try to click on the firefox dock icon as it's quitting just nothing happens. Actually it automatically starts up again after it's quit. So I don't think it's possible to start up an app again before it's fully quit on macOS.
User avatar
therube
Posts: 21698
Joined: March 10th, 2004, 9:59 pm
Location: Maryland USA

Re: keyboard shortcut to restart firefox? [Mac]

Post by therube »

(
I don't know how you would politely close a process on the Mac OS.
kill -9
;-)
)
Fire 750, bring back 250.
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript
siffemoz
Posts: 250
Joined: January 29th, 2016, 4:36 pm

Re: keyboard shortcut to restart firefox? [Mac]

Post by siffemoz »

Hi, unfortunately morat's code no longer works on 58 beta or 59 nightly :-( Can it be revived?

Edit: I haven't updated to 57 yet, so can't say if it still works there.
morat
Posts: 6403
Joined: February 3rd, 2009, 6:29 pm

Re: keyboard shortcut to restart firefox? [Mac]

Post by morat »

It succeeds in Fx 57. It fails in Fx 58. The header-small.png image isn't available in Fx 58.

Try this:

Code: Select all

/* Firefox userContent.css */

@-moz-document url-prefix("about:addons"),
url-prefix("chrome://mozapps/content/extensions/extensions.xul") {
  #updates-restart-btn {
    display: -moz-box !important;
  }
  #updates-restart-btn .button-icon {
 /* list-style-image: url("chrome://browser/skin/panic-panel/header-small.png") !important; */
 /* list-style-image: url("chrome://browser/content/abouthome/restore.png") !important; */
    list-style-image: url("chrome://branding/content/icon32.png") !important;
  }
  #updates-restart-btn .button-text {
    display: none !important;
  }
}
http://dxr.mozilla.org/mozilla-release/ ... nsions.xul
http://dxr.mozilla.org/mozilla-release/ ... -small.png
http://dxr.mozilla.org/mozilla-release/ ... ersion.txt

http://dxr.mozilla.org/mozilla-beta/sea ... nsions.xul
http://dxr.mozilla.org/mozilla-beta/sea ... -small.png
http://dxr.mozilla.org/mozilla-beta/sou ... ersion.txt
siffemoz
Posts: 250
Joined: January 29th, 2016, 4:36 pm

Re: keyboard shortcut to restart firefox? [Mac]

Post by siffemoz »

Works! Thanks much, morat.
Post Reply