NAME
MozRepl::Plugin::Restart - Restart Firefox/Thunderbird
VERSION
version 0.02
SYNOPSIS
use MozRepl;
my $repl = MozRepl->new;
$repl->setup({ plugins => { plugins => [qw/Restart/] } });
$repl->restart; ### and restart your Firefox or Thunderbird
DESCRIPTION
Add restart() method to MozRepl.
Restart your Firefox/Thunderbird using JavaScript
In the MDC Code snippets:Miscellaneous(http://developer.mozilla.org/en/docs/Code_snippets:Miscellaneous#Restarting_Firefox.2FThunderbird)
var nsIAppStartup = Components.interfaces.nsIAppStartup;
Components.classes["@mozilla.org/toolkit/app-startup;1"].getService(nsIAppStartup).quit(nsIAppStartup.eForceQuit | nsIAppStartup.eRestart);
MozRepl object (default "repl") has attribute "Ci" and "Cc". "Ci" is alias Components.interfaces, "Cc" is alias Components.classes. So restart script will be here,
(function(repl) {
var nsIAppStartup = repl.Ci.nsIAppStartup;
repl.Cc["@mozilla.org/toolkit/app-startup;1"].getService(nsIAppStartup).quit(nsIAppStartup.eForceQuit | nsIAppStartup.eRestart);
})(window.repl);
METHODS
execute($ctx, $args)
- $ctx
-
Context object. See MozRepl.
- $args
-
Hash reference.
SEE ALSO
AUTHOR
Toru Yamaguchi, <zigorou@cpan.org>
BUGS
Please report any bugs or feature requests to bug-mozrepl-plugin-restart@rt.cpan.org
, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
COPYRIGHT & LICENSE
Copyright 2007 Toru Yamaguchi, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.