But if I understand you correctly, then you are saying there is no way to get there?

No, I am saying you have to learn more about mozrepl/firefox/javascript and create your own one of these

sub eval_in_page { my ($self,$str,$env,$doc,$window) = @_; $env ||= {}; my $js_env = {}; $doc ||= $self->document; # do a manual transfer of keys, to circumvent our stupid # transformation routine: if (keys %$env) { $js_env = $self->repl->declare(<<'JS')->(); function () { return new Object } JS for my $k (keys %$env) { $js_env->{$k} = $env->{$k}; }; }; my $eval_in_sandbox = $self->repl->declare(<<'JS', 'list'); function (w,d,str,env,caller,line) { var unsafeWin = w.wrappedJSObject; var safeWin = XPCNativeWrapper(unsafeWin); var sandbox = Components.utils.Sandbox(safeWin); sandbox.window = safeWin; sandbox.document = d; // Transfer the environment for (var e in env) { sandbox[e] = env[e] sandbox.window[e] = env[e] } sandbox.__proto__ = unsafeWin; var res = Components.utils.evalInSandbox(str, sandbox, "1.8",c +aller,line); return [res,typeof(res)]; }; JS $window ||= $self->tab->{linkedBrowser}->{contentWindow}; # Report errors from scope of caller # This feels weirdly backwards here, but oh well: #local @CARP_NOT = (ref $self->repl); # we trust this my ($caller,$line) = (caller)[1,2]; $eval_in_sandbox->($window,$doc,$str,$js_env,$caller,$line); };

In reply to Re^7: Executing JavaScript function using WWW::Mechanize::Firefox by Anonymous Monk
in thread Executing JavaScript function using WWW::Mechanize::Firefox by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.