- BACK ENDS
- AUTHOR & COPYRIGHT
- SEE ALSO
Version 0.010 (alpha)
You can pass options to the plugin via the
use_plugin method. It takes hash-style arguments and they are as follows:
Use this to provide a custom
alertfunction. The default one will print its arguments followed by a new line.
alert, but for the
confirmfunction instead. There is no default.
use_plugin method will return a plugin object. The same object can be retrieved via
Sets the named variable to the value given. If you want to assign to a property of a property ... of a global property, pass each property name as a separate argument:
You should pass a hash ref that has the structure described in HTML::DOM::Interface, except that this method also accepts a
_constructor => 'new'.
For a list of the properties of the window object, see WWW::Mechanize::Plugin::DOM::Window.
screen object, which is empty. Later this may be moved to the DOM plugin's window object, but that should make little difference to you, unless you are writing bindings for another scripting language.
required by this plugin implicitly when its name is passed to the
The following methods must be implemented:
This method is passed a window (WWW::Mechanize::Plugin::DOM::Window) object.
This method can optionally create
framesproperties that refer to the global object, but this is not necessary. It might make things a little more efficient.
Finally, it has to return an object that implements the interface below.
The back end has to do some magic to make sure that, when the global object is passed to another JS environment, references to it automatically point to a new global object when the user (or calling code) browses to another page.
For instance, it could wrap up the global object in a proxy object that delegates to whichever global object corresponds to the document.
These correspond to those listed above for the plugin object. Those methods are simply delegated to the back end, except that
bind_classesalso does some caching if the back end hasn't been initialised yet.
- event2sub ($code, $elem, $url, $first_line)
This method needs to turn the event handler code in
$codeinto a coderef, or an object that can be used as such, and then return it. That coderef will be called with an HTML::DOM::Event object as its sole argument. It's return value, if defined, will be used to determine whether the event's
preventDefaultmethod should be called.
This will be called with a list of property names representing the 'path' to the property. The last argument will be a coderef that must be called with the value assigned to the property.
Note: This is actually not used right now. The requirement for this may be removed some time before version 1.
perl 5.8.3 or later (actually, this module doesn't use any features that perl 5.6 doesn't provide, but its prerequisites require 5.8.3)
HTML::DOM 0.010 or later
JE 0.022 or later (when there is a SpiderMonkey binding available it will become optional)
The experimental version of WWW::Mechanize available at http://www-mechanize.googlecode.com/svn/wm/branches/plugins/, revision 506 or higher
There is currently no system in place for preventing pages from different sites from communicating with each other.
To report bugs, please e-mail the author.
Copyright (C) 2007-8 Father Chrysostomos <
join '@', sprout => join '.', reverse org => 'cpan'>
This program is free software; you may redistribute it and/or modify it under the same terms as perl.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 438:
You forgot a '=back' before '=head1'