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 | |
|
Re^2: WWW::Mechanize::Firefox / MozRepl::RemoteObject
by janh˛ (Initiate) on Apr 02, 2012 at 07:39 UTC |