Skip to content

fix: allow the PDF viewer to show a save file picker again - #53313

Merged
jkleinsc merged 1 commit into
mainfrom
fix/pdf-viewer-save-file-picker
Aug 31, 2026
Merged

jkleinsc merged 1 commit into
mainfrom
fix/pdf-viewer-save-file-picker

Conversation

@MarshallOfSound

Copy link
Copy Markdown
Member

Description of Change

Fixes #53286
Refs CL:7806164

  • Chromium 150 moved the authoritative cross-origin file-picker check from the renderer-side ContentClient::IsFilePickerAllowedForCrossOriginSubframe() to a new browser-side ContentBrowserClient::IsCrossOriginSubframeAllowedToShowFilePicker() hook. Electron only overrode the old hook (fix: allow PDF viewer to show save file picker #51042), so the browser-side check fell through to the default and denied the PDF viewer's "save with your changes" picker with NotAllowedError: Third party iframes are not allowed to show a file picker.
  • Override the new hook for the PDF extension origin, matching Chrome's fast path in ChromeContentBrowserClient.

Verified locally on Linux by loading a PDF and calling window.showSaveFilePicker() from the PDF extension frame with a user gesture: before this change it rejects with the error above, after it the native save dialog opens.

Checklist

Release Notes

Notes: Fixed the PDF viewer failing to save an edited PDF with NotAllowedError: Third party iframes are not allowed to show a file picker.

@MarshallOfSound MarshallOfSound added semver/patch backwards-compatible bug fixes target/43-x-y PR should also be added to the "43-x-y" branch. target/44-x-y PR should also be added to the "44-x-y" branch. target/45-x-y PR should also be added to the "45-x-y" branch. labels Aug 30, 2026
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Aug 30, 2026
Chromium 150 (CL 7806164) moved the authoritative cross-origin file picker
check from the renderer-side ContentClient hook to a new browser-side
ContentBrowserClient::IsCrossOriginSubframeAllowedToShowFilePicker() hook.
Electron only overrode the old hook, so the browser-side check fell through
to the default (deny) and the PDF viewer's "save with your changes" flow
failed with NotAllowedError: Third party iframes are not allowed to show a
file picker.

Override the new hook for the PDF extension origin, matching what Chrome
does in ChromeContentBrowserClient.
@MarshallOfSound
MarshallOfSound force-pushed the fix/pdf-viewer-save-file-picker branch from cae015a to cbf600f Compare August 30, 2026 06:45
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Aug 31, 2026
@jkleinsc
jkleinsc merged commit d137642 into main Aug 31, 2026
80 checks passed
@jkleinsc
jkleinsc deleted the fix/pdf-viewer-save-file-picker branch August 31, 2026 15:32
@release-clerk

release-clerk Bot commented Aug 31, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed the PDF viewer failing to save an edited PDF with NotAllowedError: Third party iframes are not allowed to show a file picker.

@trop

trop Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "45-x-y", please check out #53326

@trop

trop Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "43-x-y", please check out #53327

@trop trop Bot removed the target/45-x-y PR should also be added to the "45-x-y" branch. label Aug 31, 2026
@trop

trop Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "44-x-y", please check out #53328

@trop trop Bot added in-flight/43-x-y in-flight/44-x-y merged/43-x-y PR was merged to the "43-x-y" branch. merged/45-x-y PR was merged to the "45-x-y" branch. and removed target/43-x-y PR should also be added to the "43-x-y" branch. target/44-x-y PR should also be added to the "44-x-y" branch. in-flight/43-x-y in-flight/45-x-y labels Aug 31, 2026
@trop trop Bot added merged/44-x-y PR was merged to the "44-x-y" branch. and removed in-flight/44-x-y labels Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

46-x-y merged/43-x-y PR was merged to the "43-x-y" branch. merged/44-x-y PR was merged to the "44-x-y" branch. merged/45-x-y PR was merged to the "45-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

PDF viewer window.showSaveFilePicker NotAllowedError

3 participants