Firefox::Application::API40 - API wrapper for Firefox 4+
use Firefox::Application; my $ff = Firefox::Application->new( # Force the Firefox 4 API api => 'Firefox::Application::API40', );
$api->updateitems( %args )
for my $item ($api->updateitems) { print sprintf "Name: %s\n", $item->{name}; print sprintf "Version: %s\n", $item->{version}; print sprintf "GUID: %s\n", $item->{id}; };
Returns the list of updateable items. Under Firefox 4, can be restricted by the type option.
type
type - type of items to fetch
ANY - fetch any item
ANY
ADDON - fetch extensions
ADDON
LOCALE - fetch locales
LOCALE
THEME - fetch themes
THEME
This method is asynchronous in Firefox 4, but is run synchronously by Firefox::Application, polling every 0.1s. Currently, no special support for AnyEvent is implemented.
$ff->addons( %args )
for my $addon ($ff->addons) { print sprintf "Name: %s\n", $addon->{name}; print sprintf "Version: %s\n", $addon->{version}; print sprintf "GUID: %s\n", $addon->{id}; };
Returns the list of installed addons as Addons. See <https://developer.mozilla.org/en/Addons/Add-on_Manager/Addon> depending.
Addon
$ff->addTab( %options )
my $new = $ff->addTab();
Creates a new tab and returns it. The tab will be automatically closed upon program exit.
The Firefox 4 API is asynchronous. The method is forced into a synchronous call here.
$ff->selectedTab( %options )
my $curr = $ff->selectedTab();
Sets the currently active tab.
$api->element_query( \@elements, \%attributes )
my $query = $element_query(['input', 'select', 'textarea'], { name => 'foo' });
Returns the XPath query that searches for all elements with tagNames in @elements having the attributes %attributes. The @elements will form an or condition, while the attributes will form an and condition.
tagName
@elements
%attributes
or
and
Max Maischein corion@cpan.org
corion@cpan.org
Copyright 2009-2012 by Max Maischein corion@cpan.org.
This module is released under the same terms as Perl itself.
To install WWW::Mechanize::Firefox, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Mechanize::Firefox
CPAN shell
perl -MCPAN -e shell install WWW::Mechanize::Firefox
For more information on module installation, please visit the detailed CPAN module installation guide.