codebytere

#52808: fix: allow downloading files inside asar archives

Merged
Created: Aug 14, 2026, 3:25:54 AM
Merged: Aug 15, 2026, 4:59:02 PM
4 comments
Target: main

Description of Change

Closes #49475.

Downloads read file: URLs straight from disk through content's FileURLLoaderFactory rather than Electron's asar-aware loader, so the PDF viewer's Save button on a packed PDF (an unedited document is saved by the browser as a download of the frame URL) and webContents.downloadURL() of any packed file both failed after the save dialog with the virtual path not existing. WebContents now handles WebContentsDelegate::SaveFrame() and translates downloadURL(), so a file: URL that points into an archive is downloaded from an extracted copy of the entry and named after the entry - no Chromium patch involved.

Checklist

  • PR description included and stakeholders cc'd
  • npm test passes
  • tests are changed or added
  • PR release notes describe the change in a way relevant to app developers

Release Notes

Notes: Fixed downloading files that live inside an asar archive, including saving a packed PDF from the built-in PDF viewer.

Backports

42-x-y
In-flight
PR Number
#52828
Waiting to be merged
43-x-y
In-flight
PR Number
#52826
Waiting to be merged
44-x-y
In-flight
PR Number
#52827
Waiting to be merged

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