Perl WWW :: Mechanize :: Firefox Screenshots Do Not Include Backgrounds

I don’t know if this is possible or not, since I just started using and learning Perl today, but I installed the WWW::Mechanize::Firefox module and set myself the task of installing the mozrepl plugin in Firefox itself to find out I could do screenshots of websites.

The script works and saves screenshot screenshot png files on websites, as expected. However, if the website uses background colors and background images, they are not included in the screenshot.

Is there a way to incorporate these things or should I admit that this is exactly how it works?

For reference, this is my simple test script:

 use WWW::Mechanize::Firefox; use Path::Class qw/file/; if(@ARGV == 2) { my $mech = WWW::Mechanize::Firefox->new( launch => 'C:\Program Files (x86)\Mozilla Firefox\firefox.exe', tab => 'current', autoclose => 'close|q', mozrepl => 'mozrepl|m:s' ); $mech->get($ARGV[0]); my $fh = file($ARGV[1])->open( '> :raw' ); print $fh $mech->content_as_png(); }; 
+4
source share
1 answer

This is similar to what happens when you print a web page.

By default, background colors / images are not used.

Firefox has a setting that allows you to print these

+1
source

All Articles