As the resource is attached to the connector it will be cleaned up when the connector is no longer in use, which in this case means when the button is removed. Testing the above on Chrome you will see that two requests to the server are made when clicking on the button:
/run/APP/connector/0/6/dl/test.pdf (the download URL)
/run/UIDL/ (the RPC request that will remove the button)
If you do the same with Firefox you will see
/run/UIDL/ (the RPC request that will remove the button)
/run/APP/connector/0/6/dl/test.pdf (the download URL)
and an additional
Feb 5, 2014 10:11:14 AM com.vaadin.server.ConnectorResourceHandler error WARNING: Ignoring connector request for no-existent connector 6 in root 0
Sounds like a classic race condition where the order of the request to the server matter. Whoever manages to lock the session first wins. If the UIDL connection comes first it will cleanup the resource before it has been served and the download fails. If it goes the other way around, everything will work.
Yes, that would be useful. We like to disable buttons on the start of a download and re-enable when complete to reduce clicking multiple downloads when it’s already in progress.
I thought I saw an issue reported saying FileDownloader extension does not work in Firefox if extending component on a subwindow (not the main window).
Someone on our project had to replace FileDownloader extension with a Link component to work around the issue. It was working in Chrome but not in Firefox.