I am working on a multi-page form filler to login to Yahoo Mail, but have run into a problem.
The code works when I run firefox in X11 with a display, but fails when I run firefox in Xvfb. Xvfb is setuid. I can watch it run in X11 with a display (which happens to be running on my mac - the server where fillform.pl runs is Debian Squeeze).
This is where the code fails in fillform.pl when I try to use Xvfb. I can see it connect to firefox from the MOZREPL log:
my $mech = WWW::Mechanize::Firefox->new() ; print "debug: going to mech->get()\n" ; $mech->get('http://mail.yahoo.com') ;
And here is the console session:
$ Xvfb :99 & $ DISPLAY=:99 firefox --display=:99 & I, MOZREPL : Listening : 127.0.0.1:4242 $ DISPLAY=:99 xdotool search --onlyvisible --title firefox 4194416 $ DISPLAY=:99 xdotool windowfocus 4194416 $ DISPLAY=:99 ~/fillform.pl I, MOZREPL : Client connected : 127.0.0.1:46357 : chrome://browser/con +tent/browser.xul I, MOZREPL : Client connected : 127.0.0.1:46358 : chrome://browser/con +tent/browser.xul debug: going to mech->get() Can't call method "addProgressListener" on an undefined value at /usr/ +local/share/perl/5.10.1/WWW/Mechanize/Firefox.pm line 574, <DATA> lin +e 1. I, MOZREPL : Client closed connection : 127.0.0.1:46358 I, MOZREPL : Client closed connection : 127.0.0.1:46357
This is line 574:
$source->addProgressListener($lsn,$NOTIFY_STATE_DOCUMENT);In reply to Headless (Xvfb) WWW::Mechanize::Firefox by onelesd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |