- BACK ENDS
- AUTHOR & COPYRIGHT
- SEE ALSO
Version 0.008 (alpha)
To load the plugin, just use WWW::Scripter's
You can pass options to the plugin via the
use_plugin method. It takes hash-style arguments and they are as follows:
use_plugin method will return a plugin object. The same object can be retrieved via
This method sets
undefif there is an error.
Sets the named variable to the value given. The first argument is the WWW::Scripter object. The last argument is the value. The intervening arguments are the names of properties, so if you want to assign to a property of a property ... of a global property, you can pass each property name separately like this:
Instead of using this method, you might consider WWW::Scripter's
class_infomethod, which is more general-purpose (it applies also to whatever other scripting languages might be available).
You should pass a hash ref that has the structure described in HTML::DOM::Interface, except that this method also accepts a
_constructor => 'new'.
This returns the back end corresponding to the WWW::Scripter object passed to it, creating it if necessary. This is intended mostly for back ends themselves to use, for accessing frames, etc.
For a list of the properties of the window object, see WWW::Scripter.
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::Scripter) 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.
This should accept up to three arguments: a string of code, the file name or URL, and the first line number.
It must set
undefif there is an error.
These correspond to those listed above for the plugin object. Unlike the above, though, this
setis not passed a window as its first argument. Also,
- event2sub ($code, $elem, $url, $first_line)
This method needs to turn the event handler code in
$codeinto an object with a
call_withmethod and then return it. That object's
call_withmethod will be called with the event target and the event object as its two arguments. Its return value, if defined, will be used to determine whether the event's
preventDefaultmethod is called.
The function's scope must contain the following objects: the global object, the document, the element's form (if there is one) and the element itself.
$codecould not be compiled, this method must set
undef, just like
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.4 or higher
HTML::DOM 0.032 or higher
JE 0.056 or later (when the SpiderMonkey binding is stable enough it will become optional)
WWW::Scripter 0.022 or higher
LWP 5.815 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.
AUTHOR & COPYRIGHT
Copyright (C) 2009-11 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'