in reply to WWW::Mechanize::Firefox / MozRepl::RemoteObject

It seems that DOM nodes do not necessarily support the .hasOwnProperty method. Until a new version of MozRepl::RemoteObject is released that does not rely on the object itself supporting hasOwnProperty, you will have to use this as a local patch workaround to MozRepl::RemoteObject:

my $getKeys = $ff->application->repl->declare(<<'JS', 'list'); function(obj){ var res = []; for (var el in obj) { if (Object.hasOwnProperty.apply(obj,[el])) { res.push(el); }; } return res } JS

But please do not use weird, undocumented methods to look inside elements. Use normal Perl hash methods:

my @keys = keys %$link;

Replies are listed 'Best First'.
Re^2: WWW::Mechanize::Firefox / MozRepl::RemoteObject
by janh˛ (Initiate) on Mar 31, 2012 at 20:14 UTC

    Thank you, I will give that a try on monday.

    I've been using keys %$link at first but thought it might have been the cause of the problem, thus changing it. I'll see to change it accordingly.

Re^2: WWW::Mechanize::Firefox / MozRepl::RemoteObject
by janh˛ (Initiate) on Apr 02, 2012 at 07:39 UTC

    I tried and ran into some other problem. Thinking I might have broken something while searching myself, I went to grab the sources from cpan and check.

    I noticed you've already published a new version, installed that one: everything works great.

    Thank you very much!