in our application, when a user click on a link, we open a new browser tab and shows a PDF to the user(the pdf is actually a base64 stream that we send from the server and it works all fine). We however noticed that on production environment (running on HTTPS), user was presented with a pop-up blocked icon and user is forced to click on it to see that PDF in adjacent tab. This issue is not coming on local machine though. We do not want Chrome to show this pop-up blocked to the user. Can you please help me here?
We are using this code to open the pdf...
let pdfWindow = window.open("");
pdfWindow.document.write("<iframe width='100%' height='100%' frameborder='0' src='data:application/pdf;base64," + encodeURI(response.base64Stream)+"'></iframe>");
答案 0 :(得分:0)
问题是我在api响应后打开了新选项卡,这个活动对浏览器是可疑的。解决方案是首先打开选项卡,然后进行api调用。收到api响应后,在选项卡中显示api数据。这工作