How can I embed a PDF within my Zendesk support app?

3 Kommentare

  • Tipene Hughes
    Zendesk Developer Advocacy

    Hey Julian,

    I'm not 100% sure what could be causing the error but a Google search returns a few results suggesting content security policy as a possible culprit. Here's a link to the docs; there's a few threads on Stack overflow that you might find helpful, as well.

    Out of curiosity, is it only on chrome that you're seeing this behaviour? 

    0
  • Julian Sam

    Hi Tipene,

    We had tried modifying alot of CSP headers, as well as iFrame sandbox attributes, but if I had to guess I would say I think its inherently due to the sandbox nature of Zendesk iFrame.

    It worked on chrome mobile, and on some other browsers, but not chrome desktop.

    Eventually we had to resort to rendering the pdf within html itself using a 3rd party package, we could not find another workaround to just use an iframe or an embed/object tag for the pdf

    0
  • Tipene Hughes
    Zendesk Developer Advocacy
    Hey Julian,

    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.
    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.

Powered by Zendesk