codebytere

#54381: fix: keep the zoom level of file: and other host-less pages across fragment navigations

Merged
Created: Sep 25, 2026, 8:26:23 AM
Merged: Sep 26, 2026, 5:48:58 AM
5 comments
Target: main

Description of Change

Fixes #44526.

After this change a loadFile() page (or any URL without a host) keeps its zoom level across location.hash changes; today the next zoomIn/zoomOut after a hash change starts over from 100%.

HostZoomMap keys zoom levels by host, and by the full URL spec, fragment included, when there is no host. A hash change therefore moved the page to a new key: getZoomLevel() fell back to the default while the renderer kept the old zoom, and the next step was computed from the default. Pages with a host were never affected.

This carries the upstream fix, https://chromium-review.googlesource.com/c/chromium/src/+/8467669 (https://crbug.com/565900884), as a patch until it rolls in: the keying URL drops its fragment in the one helper every zoom call site uses, including Electron's WebContentsZoomController. A spec loads a file page, sets level 2, changes the hash and expects 2; main reads 0.

Checklist

Release Notes

Notes: Fixed the zoom level resetting on file: and other host-less pages after a location.hash change.

Backports

43-x-y
Merged
PR Number
#54440
Merged At
Sep 26, 2026, 6:56:35 AM
Released In
Not yet
Release Date
Not yet
44-x-y
Merged
PR Number
#54442
Merged At
Sep 26, 2026, 7:06:07 AM
Released In
Not yet
Release Date
Not yet
45-x-y
Merged
PR Number
#54441
Merged At
Sep 26, 2026, 6:58:30 AM
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