MozillaZine

keyboard shortcut to restart firefox? [Mac]

User Help for Mozilla Firefox
Ed1
 
Posts: 908
Joined: January 30th, 2005, 2:33 pm

Post Posted December 2nd, 2017, 6:45 am

Thanks, morat.

Is there any way to place this button, or a button with the same restart function, on the Navigation Toolbar?

morat
 
Posts: 2905
Joined: February 3rd, 2009, 6:29 pm

Post Posted December 2nd, 2017, 9:36 am

@Ed1

It is not possible with the userChrome.css file or with a WebExtension.

Ed1
 
Posts: 908
Joined: January 30th, 2005, 2:33 pm

Post Posted December 2nd, 2017, 9:56 am

OK, thanks, morat. Sorry to hear that. It would be a useful addition.

Just so I understand then, your .css code seems to make a restart button always available on the Addons page, rather than the default behavior which is to not show a Restart button on that page unless there is a reason that a restart would be required. Is that correct?

I can't think of when Firefox 57+ would display a Restart button, since Addons now are immediately installed and uninstalled without a Restart being necessary.

The reason I would like a Restart button is to reload Firefox with current tabs open after they and perhaps many other tabs have been opened and/or closed during a very long browser session that has caused RAM ussage to go way up. A restart would be a way to reduce RAM usage during further browser use. With the old Restart addons, that was easily accomplished with either a Restart button or a Restart entry in the File menu. Now it seems impossible.

Gingerbread Man

User avatar
 
Posts: 7742
Joined: January 30th, 2007, 10:55 am

Post Posted December 2nd, 2017, 11:18 am

  1. Shift + F2
  2. restart
  3. Shift + F2
You can send the above to Firefox by creating a macro in either your mouse or keyboard software, or your operating system settings. You'll need to insert a delay in between the commands at some point; how many milliseconds is appropriate varies depending on the system. If such a feature isn't available, you can use an external utility like AutoHotkey for Windows or BetterTouchTool for Mac.

morat
 
Posts: 2905
Joined: February 3rd, 2009, 6:29 pm

Post Posted December 2nd, 2017, 11:44 am

Ed1 wrote:Is that correct?

Yes.

Ed1 wrote:I can't think of when...

It is possible to install legacy extensions in Fx 57+ nightly build so the about:addons restart button is still available.

Ed1
 
Posts: 908
Joined: January 30th, 2005, 2:33 pm

Post Posted December 3rd, 2017, 6:13 am

Thanks, Gingerbread Man! I tried that sequence manually on my Win10 system with FF57 open. Just to clarify what worked for me was:

1. Shift + F2 (to open the console at the bottom of the screen)
2. Type: restart
3. Press: Enter key (to restart Firefox)
4. Shift + F2 (to close the console at the bottom of the screen)

I've noticed lately that when FF57 is restarted, it restarts minimized to the Windows tray area. With the old Restart addons, it used to restart maximized and in focus. So, I'm looking for a way to restart maximized.

I don't know anything about macros or scripting, but I looked at the Autohotkey web page and it looks interesting. I might give it a try!

Gingerbread Man

User avatar
 
Posts: 7742
Joined: January 30th, 2007, 10:55 am

Post Posted December 3rd, 2017, 8:14 am

Ed1 wrote:Thanks, Gingerbread Man!

You're welcome.
Ed1 wrote:I've noticed lately that when FF57 is restarted, it restarts minimized to the Windows tray area. With the old Restart addons, it used to restart maximized and in focus. So, I'm looking for a way to restart maximized.

I can't reproduce that in Nightly.

The following AutoHotkey script does the job. I don't know why the maximize command doesn't work when it's fine in a separate script by itself. I included it commented out, for reference. The following script maximizes the window via keyboard shortcut instead. Paste it into Notepad, then save it as "Restart Firefox.ahk" including the quotation marks.
Code: Select all
WinActivate, ahk_exe firefox.exe ; Focus the Firefox window
SendInput, +{F2} ; Open the Developer Toolbar
Sleep, 350 ; Wait 350ms
SendInput, restart{Enter} ; Type "restart" then press Enter
Sleep, 4250 ; Wait 4.25s for Firefox to load completely
SendInput, +{F2} ; Close the Developer Toolbar
WinActivate, ahk_exe firefox.exe ; Focus the Firefox window
; I can't get the maximize command to work, though it works in other scripts.
; WinMaximize, ahk_exe firefox.exe ; Maximize the Firefox window
SendInput, !{Space}x
Return

I haven't tried, but you can probably launch it from a Firefox toolbar button using the External Application Button add-on.

siffemoz
 
Posts: 116
Joined: January 29th, 2016, 4:36 pm

Post Posted June 26th, 2018, 3:24 pm

This little gem from morat earlier in this thread no longer works :-( Can it be fixed?

/* 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;
}
}

morat
 
Posts: 2905
Joined: February 3rd, 2009, 6:29 pm

Post Posted June 26th, 2018, 5:22 pm


siffemoz
 
Posts: 116
Joined: January 29th, 2016, 4:36 pm

Post Posted June 26th, 2018, 8:15 pm

Missing in all releases, apparently. So no way to revive it?

siffemoz
 
Posts: 116
Joined: January 29th, 2016, 4:36 pm

Post Posted June 26th, 2018, 10:32 pm

And typing restart at the console no longer works either. They even removed SHFT-F2 to get right to the console!

morat
 
Posts: 2905
Joined: February 3rd, 2009, 6:29 pm

Post Posted June 27th, 2018, 6:05 am

siffemoz wrote:So no way to revive it?

*** for advanced users only ***

You could use the CustomizableUI.createWidget method to create a restart button.

I don't know if the hack works in Nightly. I'm using similar buttons in the release build.

Firefox Quantum compatible userChrome.js
http://github.com/Sporif/firefox-quantum-userchromejs

Restart Button
http://gist.github.com/Sporif/ad6e917d87787491538bac80d3c8918c

CustomizableUI
http://developer.mozilla.org/docs/Mozilla/JavaScript_code_modules/CustomizableUI.jsm
http://developer.mozilla.org/docs/Mozilla/JavaScript_code_modules/CustomizableUI.jsm/API-provided_widgets
Last edited by morat on June 28th, 2018, 3:00 am, edited 1 time in total.

siffemoz
 
Posts: 116
Joined: January 29th, 2016, 4:36 pm

Post Posted June 27th, 2018, 2:13 pm

Thanks morat. I can't quite get it right. Where should the button appear?

Steps taken:

1. Put this into my existing userChrome.css:
@namespace url
(http://www.mozilla.org/keymaster/gateke ... s.only.xul);
toolbarbutton#alltabs-button {
-moz-binding: url("userChrome.xml#js");
}

2. Copied userChrome.js and userChrome.xml to the Chrome folder

3. Replaced contents of userChrome.js with the code from RestartFirefoxButton_Movable.uc.js

morat
 
Posts: 2905
Joined: February 3rd, 2009, 6:29 pm

Post Posted June 27th, 2018, 3:55 pm

@siffemoz

* right click the menu bar
* left click the customize menu item

Is there a restart button in the customize firefox tab? If so, then drag the button to a toolbar.

siffemoz
 
Posts: 116
Joined: January 29th, 2016, 4:36 pm

Post Posted June 27th, 2018, 10:55 pm

I had already tried that, expecting to find it there, but nope.

Return to Firefox Support


Who is online

Users browsing this forum: Google Adsense [Bot] and 15 guests