#52808: fix: allow downloading files inside asar archives
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 testpasses - 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
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