Firefo...:Image(3pm)

πŸ“¦
version 1.63 Β· 3 versions
, in debian trixie

✨ Firefo...:Image(3pm) β€” aka Firefox::Marionette::Image ✨

okay bestie, welcome to the User Contributed Perl Documentation corner of the universe 🫢 this is the manual page for Firefox::Marionette::Image, section 3pm, and she is iconic and also extremely niche. if you've ever wanted a Perl object that is an image from a webpage, this is literally it. no cap.


🌸 NAME 🌸

Firefox::Marionette::Image β€” the little class that represents an image you got back from the images method. that's it, that's the whole job, and she does it beautifully πŸ’…


πŸŽ€ VERSION πŸŽ€

Version 1.63 β€” yes queen, we're on 1.63, write it down πŸ“


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the whole vibe in code form, copy it exactly bestie:

use Firefox::Marionette();
use v5.10;

my $firefox = Firefox::Marionette->new()->go('http://metacpan.org');;
foreach my $image ($firefox->images()) {
    say "Image at " . $link->URI() . " has a size of " . join q[x] $image->width(), $image->height();
}

so you boot up a Firefox::Marionette, you go to http://metacpan.org, you loop over everything images() hands you, and for each one you print where it lives and how big it is with width() and height(). slay.


πŸ’– DESCRIPTION πŸ’–

This module is a subclass of Firefox::Marionette::Element, and the whole reason she exists is to be compatible with WWW::Mechanize::Image. so if you're coming from that world, hi, you already know the assignment 😌


🌈 SUBROUTINES/METHODS 🌈

every method, no skipping, we're doing the full tour because we respect the craft πŸ‘‘

⭐ alt

returns the alternative text for the image. that's the <alt> text, the accessible one, the one that matters 🫢 the docs live over at https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt if you wanna go read up, iykyk.

⭐ attrs

returns the attributes for the link as a hash.

⭐ base

returns the base url to which all links are relative.

⭐ height

returns the image height.

⭐ name

returns the name attribute, if any. if there isn't one, well. there isn't one 🀷

⭐ new

accepts an element as a parameter and returns an image object. constructor behavior, main character energy fr.

⭐ tag

returns the tag, and it's one of: "a", "area", "frame", "iframe" or "meta". those five. exactly those five. don't come at me with anything else πŸ’€

⭐ url

returns the URL of the link.

⭐ URI

returns the URL as a URI::URL object. capital letters, bestie, don't lowercase it, Perl cares 😭

⭐ url_abs

returns the URL as an absolute URL string.

⭐ width

returns the image width.


πŸ™ˆ DIAGNOSTICS πŸ™ˆ

None. literally none. she doesn't yell at you, she's chill like that πŸ’œ


🧚 CONFIGURATION AND ENVIRONMENT 🧚

Firefox::Marionette::Image requires no configuration files or environment variables. nothing to set up, nothing to export, just vibes ✨


πŸ“ DEPENDENCIES πŸ“

Firefox::Marionette::Image requires the following non-core Perl modules:

  • URI

that's the whole list. one single item. tiny, but mighty πŸŽ€


πŸ’€ INCOMPATIBILITIES πŸ’€

None reported. we love a conflict-free queen.


πŸ”₯ BUGS AND LIMITATIONS πŸ”₯

wanna report a bug, or peek at the current list of bugs? go here: https://github.com/david-dick/firefox-marionette/issues. the maintainers are literally waiting for you, do not be shy 🌸


πŸ‘‘ AUTHOR πŸ‘‘

David Dick "<ddick@cpan.org>" β€” thank you for your service, legend 🫑


Copyright (c) 2024, David Dick "<ddick@cpan.org>". All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See "perlartistic" in perlartistic.


😭 DISCLAIMER OF WARRANTY 😭

okay so this part is the serious part, so listen up and don't skim, because it's real:

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

and that's the page!! this was Firefo...:Image(3pm), running on perl v5.40.1, dated 2025-03-16. go forth and grab those image dimensions bestie, you've got this πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from