MozRepl::Plugin::Restart - Restart Firefox/Thunderbird


MozRepl-Plugin-Restart documentation  | view source Contained in the MozRepl-Plugin-Restart distribution.

Index


NAME

Top

MozRepl::Plugin::Restart - Restart Firefox/Thunderbird

VERSION

Top

version 0.02

SYNOPSIS

Top

    use MozRepl;

    my $repl = MozRepl->new;
    $repl->setup({ plugins => { plugins => [qw/Restart/] } });

    $repl->restart; ### and restart your Firefox or Thunderbird

DESCRIPTION

Top

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

Top

execute($ctx, $args)

$ctx

Context object. See MozRepl.

$args

Hash reference.

SEE ALSO

Top

MozRepl
mozrestart

AUTHOR

Top

Toru Yamaguchi, <zigorou@cpan.org>

BUGS

Top

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

Top


MozRepl-Plugin-Restart documentation  | view source Contained in the MozRepl-Plugin-Restart distribution.