Skip to content

PDFs won't render in Chrome #1314

@bgrgicak

Description

@bgrgicak

In #1298 we enabled PDF loading in Playground, but it still didn't allow PDF previews in Chrome while it works in Firefox (try this blueprint).

It turns out that any sandbox attribute on iframes will block PDFs from loading. I couldn't find any documentation on it but a comment from StackOverflow suggests the same.

There is a note in the MDN documentation about embedded documents: it is strongly discouraged to use both allow-scripts and allow-same-origin, as that lets the embedded document remove the sandbox attribute. I assume that Chrome does something different.

We explored removing the sandbox attribute in #1313 but decided that it's not worth the risk.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions