Left-click on download-link not working in Extension

Hi there!

I have a new problem with an existing extension of mine (“Winder’s Poll Panel”). This extension is able to be displayed in any language by using custom translations, which have been sent to me. To do that, someone would download the template (a JSON file with comments named xx-XX.json.template), enter the translations and send it to me via email.
Unfortunately, a left-click on the download-link does open a new tab, but not trigger the download. But when I open the link using the middle mouse button, the link is opened in a new tab and the download starts.

Here is my code for downloading the template, copied from the rendered HTML from inside Twitch:

<a href="https://wppft.windernet.de/translations/template" target="_blank">Vorlage für Übersetzungen</a>

I did add the link to the list of allowed links in the extension’s configurations:

Does anyone know why a left-click does not trigger the download?

That suggests a problem with the server not force downloading the file.

Not an exetensions problem.

As the tab opened and navigated, how it’s opened shoudln’t make a difference but apparently does.

You can check your server logs to see if it loaded.
And/or chrome inspector for any client side issues.
This could also be the browser blocking multiple downloads and that alert for that not popping.

Thank you for your answer!

I did check the log files of my server and the request was listed there. The browser (or browsers; I did try Chrome and Firefox and both do have the same problem) did send the request and receive the response. But the browser does log nothing into console or network traffic.

Firefox did just display a blank page and even prevented reloading the page. Chrome did also display a blank page, but reloading was possible and did trigger the download. But as soon as I did start network analasys in Firefox, the download was triggered, too.

It seems that this is a browser issue. I hope it will be fixed soon.

I think it’s a “browsers don’t like it if a newly opened windows only purpose is to download a fail, when opened via target=_blank” as a security precaution to stop “drive by downloads” of bad content.

So I don’t think it’s gonna get fixed, as it’s a security matter.

Best bet is to link to a page, that then displays the thing to click to Trigger the download.
Then that page would also house the “upload the translations” page too. As well as all the instructions for providing translations, said page can also be linked to “outside” of the extension

That also might be possible. Your idea is a good one, too. Thanks for all your help!

1 Like