WWW::Mechanize::Firefox - remove welcome text

64 views Asked by At

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');

<>; 
1

There are 1 answers

0
Borodin On

The banner is only displayed when WWW::Mechanize::Firefox creates a new browser tab to work with, so the obvious way is to use an existing tab in the browser

If this isn't convenient then you must create a new Firefox::Application object, and use that to create a tab of your own without the banner

The problem is that WWW::Mechanize::Firefox ordinarily passes its options to both of these steps, and writing the code manually breaks that connection. The best way is perhaps to subclass WWW::Mechanize::Firefox to provide a new constructor that behaves to your liking

May 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?