How can I configure WWW::Mechanize::Plugin::Display, so that the plug-in always opens a new window and not only a new tab?
The module uses HTML::Display
for opening a browser, which in turn uses the environment variable PERL_HTML_DISPLAY_COMMAND
for determining the command for opening a browser. So, if you want to use Firefox, for example, you can set that variable to firefox -browser %s
to force opening a new window.
http://search.cpan.org/~corion/HTML-Display-0.39/lib/HTML/Display.pm
EDIT:
Sorry, this doesn't seem to work either. It opens a new empty window for each call to $mech->display
, but also one tab for each call in which it then displays the content. Maybe you can find other command line options for Firefox or another browser that allows you to get the wanted behavior.
As an alternative you can configure your browser to always open new windows in new windows instead of new tabs (for Firefox: Preferences -> Tabs -> Open new windows in a new tab instead
). If you want to keep that setting for your normal browsing, you can create an own profile for your Mechanize tests and add -P <your-test-profile>
to your display command.