Hello!
One of my functionalities of my custom app is to show a PDF from a URL based on the ticket, but whether I use the <embed> tag or the <iframe> tag to show the PDF, it does not load in my chrome browser. When using an <embed> tag I get the following error:
"Failed to load as a plugin, because the frame into which the plugin is loading is sandboxed"
When using the <iframe> for pdf, it doesn't give an error in the console but it doesn't load at all.
Yeah I think you're right. While CSP directives would result in the PDF blocked if they were present, the sandbox attributes would result in the same result whether or not CSP is implemented. It appears that this is a problem specific to chrome browsers - I've run a few tests in firefox and safari and the iframe'd PDFs are loading as expected, as long as CSP headers aren't present.
Unfortunately we don't have any control of the way chrome implements the sandbox rules so I think a workaround such as the one you mentioned is probably your best course of action here.