Added (messy) support for handling browser downloads