I am currently trying to trigger a file download using following code in Javascript:
window.location.href = downloadUrl;
That works fine in Chrome, IE and Edge, but Firefox unloads the page due to the new URL and hence closes all opened websockets. I know that this is an odd mannerism of FF, but is there any workaround which I can use?
It would work with window.open(downloadUrl);
and closing the new tab after a certain timeout, but I would like to prevent opening a new tab just for triggering the download.
Any help would be appreciated, thanks.