Restart button for Firefox 58+

Discussion of general topics about Mozilla Firefox
User avatar
Frank Lion
Posts: 21173
Joined: April 23rd, 2004, 6:59 pm
Location: ... The Exorcist....United Kingdom
Contact:

Restart button for Firefox 58+

Post by Frank Lion »

An extension to do this still doesn't seem to exist for Firefox 57+, so...

...a simple, but useful, idea for this - Enter about:profiles > right click tab and select Pin Tab > you're done.

Just use the second button down on the right of that page to restart.

If you do a lot of restarts (for example, when theming the fine tuning of text colours can get up to the 30 - 60 restarts an hour type speeds) then here's some optional code for userContent.css that will stop you hitting the SafeMode button by mistake -

Code: Select all

/*Franks Whack SafeMode button in about:profiles....*/
@-moz-document url(about:profiles) {
#restart-in-safe-mode-button {
	display: none !important;
}}
...and, just because everyone always likes pics, you'll end up with something like this -


Image

^ click for full size.
"The only thing necessary for the triumph of evil, is for good men to do nothing." - Edmund Burke (attrib.)
.
NanM
Posts: 182
Joined: September 16th, 2008, 1:04 am
Location: SW WAustralia

Re: Restart button for Firefox 58+

Post by NanM »

Nice, Frank Lion.

I've needed restart a lot while getting used to Quantum and its quirky approach to
extension development. Not a dev myself but trying to help a couple of local users redo their
homemade intranet helpers.
And... for we of fading eyesight, your workaround button is easier to target than a toolbar one anyway.
Ta v much! Might use it in this Gecko too .
Restarting now...ALT 1 , point/click.
morat
Posts: 6404
Joined: February 3rd, 2009, 6:29 pm

Re: Restart button for Firefox 58+

Post by morat »

The about:addons page uses the nsIAppStartup.eRestart constant in the extensions.js file.
The about:profiles page uses the nsIAppStartup.eRestartNotSameProfile constant in the aboutProfiles.js file.

Does the about:profiles command restart the default profile when using a non-default profile?

nsIAppStartup constants
http://developer.mozilla.org/en-US/docs ... #Constants

Reference
http://dxr.mozilla.org/mozilla-release/ ... p.eRestart
http://dxr.mozilla.org/mozilla-release/ ... ersion.txt
User avatar
Frank Lion
Posts: 21173
Joined: April 23rd, 2004, 6:59 pm
Location: ... The Exorcist....United Kingdom
Contact:

Re: Restart button for Firefox 58+

Post by Frank Lion »

morat wrote:Does the about:profiles command restart the default profile when using a non-default profile?
No. Providing the user has previously selected the non-default profile in the usual approved way - http://kb.mozillazine.org/Profile_Manager


I'll swear some of these guys think I fell off the back of a turnip truck yesterday and wouldn't have already checked that! :)
Last edited by Frank Lion on February 6th, 2018, 10:58 am, edited 1 time in total.
"The only thing necessary for the triumph of evil, is for good men to do nothing." - Edmund Burke (attrib.)
.
User avatar
madmudmob
Posts: 810
Joined: August 30th, 2006, 7:34 am
Location: Somerset, UK

Re: Restart button for Firefox 58+

Post by madmudmob »

I found this which really does make a Restart button (and am chuffed with myself that I eventually got it right and the button in the toolbar works) ......
https://www.reddit.com/r/FirefoxCSS/com ... le_please/
Mud is good!
morat
Posts: 6404
Joined: February 3rd, 2009, 6:29 pm

Re: Restart button for Firefox 58+

Post by morat »

Okay. I've been using the portable version for so long I've forgotten how to use the profile manager.
Frank Lion wrote:fell off the back of a turnip truck
I heard it was a fish truck. :wink:

http://imgur.com/2NhE4eY
User avatar
Frank Lion
Posts: 21173
Joined: April 23rd, 2004, 6:59 pm
Location: ... The Exorcist....United Kingdom
Contact:

Re: Restart button for Firefox 58+

Post by Frank Lion »

morat wrote:Okay. I've been using the portable version for so long I've forgotten how to use the profile manager.
Don't worry about it, if you remember just how bad the functionality of the 'Create New Profile' was on the about:profiles page was when they first rushed it out, then Mozilla couldn't even find its own profilemanager, let alone use it. :P

Dreadfully worded that about:profiles page all the way through. 1,000 people working full-time for Mozilla these days and not one of them can write one simple page right or even understand how the average user thinks/understands.
"The only thing necessary for the triumph of evil, is for good men to do nothing." - Edmund Burke (attrib.)
.
User avatar
the-edmeister
Posts: 32249
Joined: February 25th, 2003, 12:51 am
Location: Chicago, IL, USA

Re: Restart button for Firefox 58+

Post by the-edmeister »

Mozilla seems to lack institutional knowledge about what Mozilla created in the past, never fully completed, and then discarded it before it came into wide usage or was "officially" released to the public. With Profiles it was an XUL Runner Profile Manager project, that iirc was part of a "Summer of Coding" internship program in 2010. Worked fine but needed a bit of tweaking to make it a Release, IMO.

https://jagriffin.wordpress.com/2011/01 ... 1-0_beta1/
http://ftp.mozilla.org/pub/utilities/profilemanager/
https://wiki.mozilla.org/Auto-tools/Pro ... ileManager

Then a few years later Mozilla decided that XUL Runner was in the cards for Firefox future with the eventual demise of XUL.
At least that's my "take" on the events surrounding that Profile Manager application which ran outside of the main Firefox process.
A mind is a terrible thing to waste. Mine has wandered off and I'm out looking for it.
User avatar
madmudmob
Posts: 810
Joined: August 30th, 2006, 7:34 am
Location: Somerset, UK

Re: Restart button for Firefox 58+

Post by madmudmob »

Anyone tried the link I posted a few above?

Working a treat for me and as an extra bonus I can use Customize to move the button wherever I want.
Mud is good!
morat
Posts: 6404
Joined: February 3rd, 2009, 6:29 pm

Re: Restart button for Firefox 58+

Post by morat »

@madmudmob

It's a nice tweak. I like the CustomizableUI.createWidget method. It's easy peasy.

CustomizableUI
http://developer.mozilla.org/en-US/docs ... ableUI.jsm
User avatar
madmudmob
Posts: 810
Joined: August 30th, 2006, 7:34 am
Location: Somerset, UK

Re: Restart button for Firefox 58+

Post by madmudmob »

Image
Mud is good!
User avatar
Frank Lion
Posts: 21173
Joined: April 23rd, 2004, 6:59 pm
Location: ... The Exorcist....United Kingdom
Contact:

Re: Restart button for Firefox 58+

Post by Frank Lion »

Somebody asked, the other day, for help showing the profile in use more easily on that about:profiles page. So, you might as well have it as well -

Code: Select all

    /*Franks about:profiles Profile in Use clearer ....*/
    @-moz-document url(about:profiles) {
    #profiles h3 {
	background: #91BFBC !important;
}}
If you wanted the whole lot and the restart button made clearer as well, you just combine it all -

Code: Select all

 /*Franks about:profiles Clearer Style....*/
    @-moz-document url(about:profiles) {
    #restart-in-safe-mode-button {
      display: none !important;
}

#profiles h3, #restart-button  {
	background: #91BFBC !important;
}}

Tip: don't change a user's choice of text colour, unless you really have to. If you don't know the text colour being used, as here, then just pick a background colour of a mid-tone hue in a pleasant, but unlikely colour and you'll be OK.
"The only thing necessary for the triumph of evil, is for good men to do nothing." - Edmund Burke (attrib.)
.
spideymouse
Posts: 16
Joined: January 9th, 2014, 9:10 am

Re: Restart button for Firefox 58+

Post by spideymouse »

Has anyone tried this addon out?

https://addons.mozilla.org/en-US/firefo ... -browser1/

I'm kind of creeped out by the amount of permissions it requires, and I am unsure how to find out what the addon actually does with all of said permissions.
morat
Posts: 6404
Joined: February 3rd, 2009, 6:29 pm

Re: Restart button for Firefox 58+

Post by morat »

The extension uses the native messaging API. I assume the extension calls an external program similar to NirCmd closeprocess to politely close Firefox, then waits until the firefox.exe process ends to start Firefox.

Native messaging
http://developer.mozilla.org/Add-ons/We ... _messaging

NirCmd closeprocess
http://nircmd.nirsoft.net/closeprocess.html
Gingerbread Man wrote:With NirCmd, you can tell Firefox to exit gracefully, wait for it to close, then relaunch it. The trouble is, that's not a true restart. Even if you have Firefox set up to show your tabs and windows from last time at startup, you'll lose things like session cookies that a restart would normally preserve.
Similar threads
http://forums.mozillazine.org/viewtopic ... &t=3033833
http://forums.mozillazine.org/viewtopic ... &t=3035617
Last edited by morat on April 3rd, 2018, 4:40 pm, edited 1 time in total.
spideymouse
Posts: 16
Joined: January 9th, 2014, 9:10 am

Re: Restart button for Firefox 58+

Post by spideymouse »

morat wrote:The extension uses the native messaging API. I assume the extension calls an external program similar to NirCmd closeprocess to politely close Firefox, then waits until the firefox.exe process ends to start Firefox.
Gingerbread Man wrote:With NirCmd, you can tell Firefox to exit gracefully, wait for it to close, then relaunch it. The trouble is, that's not a true restart. Even if you have Firefox set up to show your tabs and windows from last time at startup, you'll lose things like session cookies that a restart would normally preserve.
Native messaging
http://developer.mozilla.org/Add-ons/We ... _messaging

NirCmd closeprocess
http://nircmd.nirsoft.net/closeprocess.html

Similar threads
http://forums.mozillazine.org/viewtopic ... &t=3033833
http://forums.mozillazine.org/viewtopic ... &t=3035617
Thank you for the info!
Post Reply