I'm having a bit of trouble with WWW::Mechanize::Firefox ( or, more specifically, MozRepl::RemoteObject, but I'm not completly sure if I just use W::M::F the wrong way).
Here's a short example that reproduces my problem with MozRepl 1.1 and Firefox versions 11 (Win 7 64 and Win XP) and 3.6.28 (Win XP) and the perl script on Win7 64, Winxp and debian linux. Perl-Versions: ActivePerl 5.10.0 on Windows, 5.10.1 on linux):

#!/usr/bin/perl use WWW::Mechanize::Firefox; my $ff = WWW::Mechanize::Firefox->new(activate => 1, autoclose => 0, ' +tab' => "current"); my @links = $ff->selector('a'); for my $link (@links) { my @keys = $link->__keys(); }

This fails in my setup with the following message: MozRepl::RemoteObject: TypeError: obj.hasOwnProperty is not a function at test-mozrepl.pl line 6

The problem seems to be in the javascript in MozRepl::RemoteObject, line 1289 in RemoteObject.pm (Version 0.30):

if (obj.hasOwnProperty(el)) {

I've tried to look into the js side, obj is of type "object" but obj.hasOwnProperty does not exist. I know too little about the interna of mozrepl and MozRepl::RemoteObject to guess smart checks I could do.

Any hints to what I am missing?
Please let me know which additional information might be helpful in diagnosing the problem.


In reply to WWW::Mechanize::Firefox / MozRepl::RemoteObject by janh˛

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.