I'm trying to open a PDF file in a new tab (or window depending on the browser config). Currently if I specify the href for a local file it works as expected, but I need to provide a link that dynamically generated by an API.
So basically:
<a href="/assets/test.pdf" target="_blank">PDF</a>
--> this works (opens the file in a new tab)
<a href="https://my-pdf-url" target="_blank">PDF</a>
--> this opens a new window, closes it immediately and download the file.
I believe this is a security measure by the browser, but is there any way to get around this behavior and show it in a new tab?