Skip to content Skip to sidebar Skip to footer

Open Pdf From Chrome Iframe Failed With Default Pdf Viewer

The code looks like: Click the PDF link inside the iframe, it opens with white content. If right click the mouse and click 'Save', it works. If open the URL to any tab or window,

Solution 1:

I just found another way to fix this. If your site needs to stick with sandbox for some reason, you can add the value allow-popups-to-escape-sandbox to fix this issue.

Solution 2:

It turns out the sandbox make the iframe lost permission to access the PDF file on Chrome, but all other web browsers do not have this behaviour.

After remove sandbox="allow-same-origin allow-popups allow-forms allow-scripts", it works.

<iframepm-attr-iframeclass="widget-body"ng-src="{{vm.iframeUrl}}">
    (not available)
</iframe>

Post a Comment for "Open Pdf From Chrome Iframe Failed With Default Pdf Viewer"