| MozRepl documentation | Contained in the MozRepl distribution. |
MozRepl::Plugin::Repl::Inspect - Inspect specified javascript object.
version 0.01
use MozRepl;
my $repl = MozRepl->new;
$repl->setup({ plugins => { plugins => [qw/Repl::Inspect/] } });
print $repl->repl_inspect({ source => 'window.getBrowser().contentWindow.location' });
Add repl_inspect() method to MozRepl.
Context object. See MozRepl.
Hash reference.
Target object, default value is current context object. (optional) (Just do it same as repl.look())
Each properties prefix label. (optional)
Limitation inspecting depth. (optional)
Start inspecting depth. (optional)
Toru Yamaguchi, <zigorou@cpan.org>
Please report any bugs or feature requests to
bug-mozrepl-plugin-repl-inspect@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 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.
| MozRepl documentation | Contained in the MozRepl distribution. |
package MozRepl::Plugin::Repl::Inspect; use strict; use warnings; use base qw(MozRepl::Plugin::Base); use MozRepl::Util;
our $VERSION = '0.01';
sub execute { my ($self, $ctx, $args) = @_; my $params = {}; for (qw/max_depth name current_depth/) { $params->{$_} = MozRepl::Util->javascript_value($args->{$_}); } $params->{source} = $args->{source} || sprintf("%s._workContext", $ctx->repl); $params->{repl} = $ctx->repl; my $command = $self->process('execute', $params); my @responses = $ctx->execute($command); return wantarray ? @responses : join("\n", @responses); }
1; # End of MozRepl::Plugin::Repl::Inspect __DATA__ __execute__ [% repl %].inspect([% source %], [% max_depth %], [% name %], [% current_depth %]); __END__