在chrome新版本上使用window.open显示base64 pdf数据(Show base64 pdf data using window.open on chrome new version)

I am using following code for open base64 data as pdf in new window

var pdf=response.data.base64;       
var doc = document.createElement("a");
doc.href ='data:application/octet-stream;base64,' + pdf;
doc.target = "blank";
doc.click();
$window.open('data:application/pdf;base64,' + pdf);

This is working fine for chrome Version 56.0.2924.87 but not working in version 61.0.3163.100 [Refer screenshot]

原文地址:https://www.cnblogs.com/suizhikuo/p/13696926.html