Restarting in nightlies

User support for problems with custom buttons

Restarting in nightlies

Postby trapper john » Mon Oct 02, 2017 2:25 pm

None of the restart buttons work in the nightlies anymore. If someone has new code that does please post.

For now I've created a .vbs file to send keys and do it through Firefox command:

Option Explicit
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys ("+{F2}")
WScript.Sleep (2500)
WshShell.SendKeys ("restart")
WshShell.SendKeys "{ENTER}"
Set WshShell = Nothing

It could probably be improved upon it does work.

The button code is as follows:

Code: Select all
var file = Components.classes[";1"].
trapper john
Posts: 102
Joined: Wed Mar 14, 2012 6:58 pm

Re: Restarting in nightlies

Postby morat » Tue Oct 03, 2017 12:29 am

Is there an error in the browser console?

Code: Select all
var os = Components.classes[";1"].
var cancelQuit = Components.classes[";1"].
os.notifyObservers(cancelQuit, "quit-application-requested", "restart");
if ( {
  Services.prompt.alert(window, "Custom Buttons", "Abort Restart Process");
} else {
  var appStartup = Components.classes[";1"].
  appStartup.quit(appStartup.eAttemptQuit | appStartup.eRestart);
Posts: 944
Joined: Wed Dec 28, 2011 2:38 pm

Re: Restarting in nightlies

Postby trapper john » Tue Oct 03, 2017 1:59 am

Nothing in the log but your code works good, much better than sending keys. I even used it to change the command in the Classic Theme Restorer restart command that's in the File menu by way of Menu Wizard, that was also broke.
trapper john
Posts: 102
Joined: Wed Mar 14, 2012 6:58 pm

Return to Buttons