payloadcms / payloadcms/payload
PDF not loading in live preview on Chrome
Open
@jacobsfletch is already working on this.
Since May 4, 2026.
area: live-preview
v3
- Dominant language
- TypeScript
- Stars
- 44.8k
- Forks
- 4.2k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 53
Description
Describe the Bug
Because of this line sandbox="allow-same-origin allow-scripts allow-forms allow-popups allow-modals allow-downloads" on the iframe, Chrome doesn't load any PDFs inside of the live preview.
I use Payload to generate and preview PDFs which is no longer working after updating Payload.
I also noticed a warning in the console:
"An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing."
Link to the code that reproduces this issue
https://github.com/LeanderG/payload
Reproduction Steps
- Run
pnpm dev _communityin the repo. - Open an item on http://localhost:3000/admin/collections/pdf-preview
- The PDF does not load in Chrome and shows the message "This page has been blocked by Chrome" instead.
Which area(s) are affected?
area: live-preview
Environment Info
Binaries:
Node: 24.14.1
npm: 11.11.0
Yarn: N/A
pnpm: 10.27.0
Relevant Packages:
payload: 3.84.1
next: 16.2.3
@payloadcms/db-postgres: 4.0.0-beta.0
@payloadcms/live-preview-react: 4.0.0-beta.0
@payloadcms/typescript-plugin: 4.0.0-beta.0
react: 19.2.4
react-dom: 19.2.4
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 25.3.0: Wed Jan 28 20:56:35 PST 2026; root:xnu-12377.91.3~2/RELEASE_ARM64_T6030
Available memory (MB): 18432
Available CPU cores: 12
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.