window.open() opens a blank screen in chrome window.open() opens a blank screen in chrome google-chrome google-chrome

window.open() opens a blank screen in chrome


While it's no longer possible to do this in Chrome, there are workarounds, such as opening a blank document and writing to it.

var win = window.open();win.document.write("<img src='"+canvas.toDataURL()+"'/>");


That's because of a recent change in Chrome:

https://developers.google.com/web/updates/2017/03/chrome-58-deprecations#remove_content-initiated_top_frame_navigations_to_data_urls

You cannot open data URLs directly anymore this way for security reasons.

Instead use the workaround proposed by @Savoo here in the other answer or use a download anchor and click it via JavaScript.