lalvin has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, I've two Firefox windows each with a unique user profile and both have MozRepl installed and started. I would like to know if it is possible to use WWW::Mechanize::Firefox to automate tasks for the two Firefox windows separately. When I create a new instance of WWW::Mechanize::Firefox, it seems that it can only control one window. I appreciate any help on this issue.
  • Comment on Automation of Multiple Windows of Firefox using WWW::Mechanize::Firefox

Replies are listed 'Best First'.
Re: Automation of Multiple Windows of Firefox using WWW::Mechanize::Firefox
by Corion (Patriarch) on Aug 15, 2014 at 11:25 UTC

    If you have "two Firefox windows", you still have one Firefox process.

    If you want an easy way to have two Firefox sessions active, install a separate instance of Firefox, for example via Portable Apps Firefox, and have the mozrepl plugin for that Firefox run on a different port.

      FWIW, a seperate profile will start a seperate process :)  firefox.exe -no-remote -P profilename
        > FWIW, a seperate profile will start a seperate process :)

        > firefox.exe -no-remote -P profilename

        exactly and separate profiles have their own add-ons.

        I'm using this approach on a daily basis.

        and via Extras > MozRepl > ChangePort menu the ports are changed on an indiviual basis.

        update

        to be able to change the port, have a look to the repl object passed to ->new in WWW::Mechanize::Firefox .

        see:

        repl - a premade MozRepl::RemoteObject instance or a connection string suitable for initializing one

        Cheers Rolf

        (addicted to the Perl Programming Language and ☆☆☆☆ :)