Mozilla::DOM::WebNavigation
Mozilla::DOM::WebNavigation is a wrapper around an instance of Mozilla's nsIWebNavigation interface. This class inherits from Supports.
Note: the nsIWebNavigation interface isn't marked FROZEN in Gecko, so it can change.
You can get this object by QueryInterfacing WebBrowser:
$iid = Mozilla::DOM::WebNavigation->GetIID; $navigation = $browser->QueryInterface($iid);
XXX: The following methods are unfortunately not wrapped yet: LoadURI, GetSessionHistory, SetSessionHistory. I'd especially like to have LoadURI, but I don't know how to do nsIInputStream for its last two arguments.
The following constants are available. You can export them all with use Mozilla::DOM::WebNavigation qw(:flags) or export them individually.
use Mozilla::DOM::WebNavigation qw(:flags)
* Normal load flag.
* Meta-refresh flag. The cache is bypassed. This type of load is * usually the result of a meta-refresh tag, or a HTTP * 'refresh' header.
* Link-click flag.
* Bypass history flag.
* Replace history entry flag.
* Stop all network activity. This includes both active network loads and * pending meta-refreshes.
* Stop all content activity. This includes animated images, plugins and * pending Javascript timeouts.
* Stop all activity.
Pass this to QueryInterface.
* Indicates if the object can go back. If true this indicates that * there is back session history available for navigation.
Note: this method is available in Gtk2::MozEmbed:
$embed->can_go_back
* Indicates if the object can go forward. If true this indicates that * there is forward session history available for navigation
$embed->can_go_forward
* The currently loaded URI or null.
Note: I think this is the same as
$embed->get_location
in Gtk2::MozEmbed.
* Retrieves the current DOM document for the frame, or lazily creates a * blank document if there is none. This attribute never returns null except * for unexpected error situations.
Note: this document is also available by doing
my $browser = $embed->get_nsIWebBrowser; my $window = $browser->GetContentDOMWindow; my $doc = $window->GetDocument;
* The referring URI.
* Tells the object to navigate to the previous session history item. When * a page is loaded from session history, all content is loaded from the * cache (if available) and page state (such as form values, scroll position) * is restored. * * @return NS_OK - Backward navigation was successful. * NS_ERROR_UNEXPECTED - This call was unexpected at this time. Most * likely you can't go back right now.
$embed->go_back()
* Tells the object to navigate to the next Forward session history item. * When a page is loaded from session history, all content is loaded from * the cache (if available) and page state (such as form values, scroll * position) is restored. * * @return NS_OK - Forward was successful. * NS_ERROR_UNEXPECTED - This call was unexpected at this time. Most * likely you can't go forward right now.
$embed->go_forward()
$index (integer (long))
* Tells the object to navigate to the session history item at index. * * @return NS_OK - GotoIndex was successful. * NS_ERROR_UNEXPECTED - This call was unexpected at this time. Most * likely you can't goto that index
$reloadFlags (integer (long))
* Tells the Object to reload the current page. * * @param reloadFlags - Flags modifying reload behaviour. Generally you will * pass LOAD_FLAGS_NONE for this parameter.
$embed->reload($flags)
(See also the section "flags Gtk2::MozEmbed::Reload" in `perldoc Gtk2::MozEmbed::main`.)
$stopFlags (integer (long))
* Stops a load of a URI. * * @param stopFlags - Flags indicating the stop behavior.
$embed->stop_load();
Mozilla::DOM
Copyright (C) 2005-2007, Scott Lanning
This software is licensed under the LGPL. See Mozilla::DOM for a full notice.
To install Mozilla::DOM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mozilla::DOM
CPAN shell
perl -MCPAN -e shell install Mozilla::DOM
For more information on module installation, please visit the detailed CPAN module installation guide.