#51042: fix: allow PDF viewer to show save file picker
Description of Change
Closes #51041
Refs CL:6111160
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.
Checklist
- I have built and tested this change
- I have filled out the PR description
- I have reviewed and verified the changes
-
npm testpasses - PR release notes describe the change in a way relevant to app developers, and are capitalized, punctuated, and past tense.
Release Notes
Notes: Fixed an issue where saving edited PDF files would fail with a cross-origin SecurityError.
Backports
Semver Impact
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron
