Skip to content

fix: allow PDF viewer to show save file picker - #51072

Merged
ckerr merged 1 commit into
42-x-yfrom
trop/42-x-y-bp-fix-allow-pdf-viewer-to-show-save-file-picker-1776294271800
Apr 16, 2026
Merged

ckerr merged 1 commit into
42-x-yfrom
trop/42-x-y-bp-fix-allow-pdf-viewer-to-show-save-file-picker-1776294271800

Conversation

@trop

@trop trop Bot commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Backport of #51042

See that PR for details.

Notes: Fixed an issue where saving edited PDF files would fail with a cross-origin SecurityError.

The PDF viewer's "save with changes" feature uses
`window.showSaveFilePicker()`, but the PDF extension runs in a
cross-origin iframe (chrome-extension:// inside the app's origin).
Chromium's File System Access API blocks cross-origin subframes from
showing file pickers unless the embedder explicitly allows them via
`ContentClient::IsFilePickerAllowedForCrossOriginSubframe()`.

Chrome overrides this in `ChromeContentClient` to allowlist the PDF
extension origin, but Electron never did — so the picker was always
blocked with a SecurityError.

This adds the same override to `ElectronContentClient`, allowing the
built-in PDF extension origin to bypass the cross-origin check.

Co-authored-by: Shelley Vohr <[email protected]>
@trop
trop Bot requested review from a team and codebytere April 15, 2026 23:04
@trop trop Bot mentioned this pull request Apr 15, 2026
5 tasks done
@trop trop Bot added 42-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Apr 15, 2026
@ckerr
ckerr merged commit 81e7616 into 42-x-y Apr 16, 2026
75 checks passed
@ckerr
ckerr deleted the trop/42-x-y-bp-fix-allow-pdf-viewer-to-show-save-file-picker-1776294271800 branch April 16, 2026 02:55
@release-clerk

release-clerk Bot commented Apr 16, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed an issue where saving edited PDF files would fail with a cross-origin SecurityError.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

42-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant