keyboard shortcut to restart firefox? [Mac]
-
- Posts: 1059
- Joined: January 30th, 2005, 2:33 pm
Re: keyboard shortcut to restart firefox? [Mac]
Thanks, morat.
Is there any way to place this button, or a button with the same restart function, on the Navigation Toolbar?
Is there any way to place this button, or a button with the same restart function, on the Navigation Toolbar?
-
- Posts: 6437
- Joined: February 3rd, 2009, 6:29 pm
Re: keyboard shortcut to restart firefox? [Mac]
@Ed1
It is not possible with the userChrome.css file or with a WebExtension.
It is not possible with the userChrome.css file or with a WebExtension.
-
- Posts: 1059
- Joined: January 30th, 2005, 2:33 pm
Re: keyboard shortcut to restart firefox? [Mac]
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.
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
- Posts: 7735
- Joined: January 30th, 2007, 10:55 am
Re: keyboard shortcut to restart firefox? [Mac]
- Shift + F2
- restart
- Shift + F2
-
- Posts: 6437
- Joined: February 3rd, 2009, 6:29 pm
Re: keyboard shortcut to restart firefox? [Mac]
Yes.Ed1 wrote:Is that correct?
It is possible to install legacy extensions in Fx 57+ nightly build so the about:addons restart button is still available.Ed1 wrote:I can't think of when...
-
- Posts: 1059
- Joined: January 30th, 2005, 2:33 pm
Re: keyboard shortcut to restart firefox? [Mac]
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!
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
- Posts: 7735
- Joined: January 30th, 2007, 10:55 am
Re: keyboard shortcut to restart firefox? [Mac]
You're welcome.Ed1 wrote:Thanks, Gingerbread Man!
I can't reproduce that in Nightly.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.
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
-
- Posts: 254
- Joined: January 29th, 2016, 4:36 pm
Re: keyboard shortcut to restart firefox? [Mac]
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;
}
}
/* 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;
}
}
-
- Posts: 6437
- Joined: February 3rd, 2009, 6:29 pm
Re: keyboard shortcut to restart firefox? [Mac]
@siffemoz
The css is still valid. The cmd_restartApp code in the extensions.js file is missing in Nightly.
http://dxr.mozilla.org/mozilla-esr60/se ... restartApp
http://dxr.mozilla.org/mozilla-esr60/so ... ersion.txt
http://dxr.mozilla.org/mozilla-central/ ... restartApp
http://dxr.mozilla.org/mozilla-central/ ... ersion.txt
The css is still valid. The cmd_restartApp code in the extensions.js file is missing in Nightly.
http://dxr.mozilla.org/mozilla-esr60/se ... restartApp
http://dxr.mozilla.org/mozilla-esr60/so ... ersion.txt
http://dxr.mozilla.org/mozilla-central/ ... restartApp
http://dxr.mozilla.org/mozilla-central/ ... ersion.txt
-
- Posts: 254
- Joined: January 29th, 2016, 4:36 pm
Re: keyboard shortcut to restart firefox? [Mac]
Missing in all releases, apparently. So no way to revive it?
-
- Posts: 254
- Joined: January 29th, 2016, 4:36 pm
Re: keyboard shortcut to restart firefox? [Mac]
And typing restart at the console no longer works either. They even removed SHFT-F2 to get right to the console!
-
- Posts: 6437
- Joined: February 3rd, 2009, 6:29 pm
Re: keyboard shortcut to restart firefox? [Mac]
*** for advanced users only ***siffemoz wrote:So no way to revive it?
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/ad6e917d8 ... 80d3c8918c
CustomizableUI
http://developer.mozilla.org/docs/Mozil ... ableUI.jsm
http://developer.mozilla.org/docs/Mozil ... ed_widgets
Last edited by morat on June 28th, 2018, 3:00 am, edited 1 time in total.
-
- Posts: 254
- Joined: January 29th, 2016, 4:36 pm
Re: keyboard shortcut to restart firefox? [Mac]
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
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
-
- Posts: 6437
- Joined: February 3rd, 2009, 6:29 pm
Re: keyboard shortcut to restart firefox? [Mac]
@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.
* 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.
-
- Posts: 254
- Joined: January 29th, 2016, 4:36 pm
Re: keyboard shortcut to restart firefox? [Mac]
I had already tried that, expecting to find it there, but nope.