Not sure how this would happen, but hey, it did
Add delay for PayPal login
Make PayPal CSV download much more reliable

Do this by submitting the download dialog form without bothering to show
it first.

To show the download dialog in a real browser, you click this link:

  #rightTextDownload a[name=custom_file_type_csv]

Previously this is what the code did, but it looks like it was often
clicking the CSV download link before it had a JavaScript handler
attached, so we visited the link href, which is not what we want.

Anyway, clicking that link does the following:

  PAYPAL.Beloved.Salsa.HistorydownloadFileType(event);

to create an event, maybe just { preventDefault : function() { } }, or:
http://stackoverflow.com/a/143771/106302

Submitting the hidden CSV download form seems to work just fine though.