0

So using this line in my HTML

<a target="_blank" href="data:application/pdf;base64,'+base64pdf+'"><img src="/img/files/pdf.png"></a>

the results are as follows:

Chrome: When I left click the < a > it opens a new tab with the URI in the address bar with a blank page and title untitled. If I right click the < a > and select open link in new tab it works fine and opens a tab with title data: and the URI on the address bar.

Firefox: Works fine both ways.

Does anyone know how I can fix this?

Constantine
  • 763
  • 2
  • 9
  • 19
  • https://productforums.google.com/forum/#!topic/chrome/wvYYcBwJ9FA — all browsers are going to block opening data URLs with simple left clicks. Chrome, IE, and Edge already do. – Pointy Mar 15 '18 at 16:00
  • @Pointy do you maybe have a method how I can do this with for example a javascript click event? – Constantine Mar 15 '18 at 16:01
  • 1
    No I have no idea; generally when browser maintainers decide to do something as a security measure, they work hard to make that completely impossible (or else what would be the point). – Pointy Mar 15 '18 at 16:02

0 Answers0