Whenever I start a WWW::Mechanize::Firefox Perl script, the first thing that loads into the browser screen are the words "WWW::Mechanize::Firefox".
How do I disable this?
My Perl code
#!perl -w
use strict;
use WWW::Mechanize::Firefox;
my $mech = WWW::Mechanize::Firefox->new( activate => 1 ); # bring the tab to the foreground
$mech->get('perlworkshop.de');
<>;
The banner is only displayed when
WWW::Mechanize::Firefoxcreates a new browser tab to work with, so the obvious way is to use an existing tab in the browserIf this isn't convenient then you must create a new
Firefox::Applicationobject, and use that to create a tab of your own without the bannerThe problem is that
WWW::Mechanize::Firefoxordinarily passes its options to both of these steps, and writing the code manually breaks that connection. The best way is perhaps to subclassWWW::Mechanize::Firefoxto provide a new constructor that behaves to your likingMay I ask why you want to do this? What is the nature of your application that you need to see specific results on the browser?