codebytere

#51042: fix: allow PDF viewer to show save file picker

Merged
Created: Apr 14, 2026, 8:34:00 AM
Merged: Apr 15, 2026, 6:04:24 PM
3 comments
Target: main

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.

Screenshot

Screenshot 2026-04-14 at 2 33 41 PM

Checklist

Release Notes

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

Backports

41-x-y
In-flight
PR Number
#51073
Waiting to be merged
42-x-y
Merged
PR Number
#51072
Merged At
Apr 15, 2026, 9:55:17 PM
Released In
Not yet
Release Date
Not yet

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

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