codebytere

#53667: chore: keep data: URLs out of the non-standard scheme origin patch

Merged
Created: Sep 7, 2026, 4:13:30 AM
Merged: Sep 7, 2026, 10:53:59 AM
3 comments
Target: main

Description of Change

fix_crash_loading_non-standard_schemes_in_iframes.patch short-circuits origin computation for every non-standard URL, in NavigationRequest::GetOriginForURLLoaderFactoryUnchecked and in DocumentLoader::CalculateOrigin, so that subframes on embedder-registered custom schemes do not trip CanAccessDataForOrigin. data: is also a non-standard scheme, so every data: navigation was taking that branch as well and skipping what Chromium does for data: right below it: reusing the nonce cached in tentative_data_origin_to_commit_ (crrev.com/c/4902624) and resolving the opaque origin against the initiator so it carries a precursor.

This excludes data: from both hunks so those navigations stay on Chromium's path in the browser and the renderer alike, and notes that in the patch description. The about:blank carve-out added in #45694 stays as is.

Verified on Linux with a testing (DCHECK) build: data: and custom non-standard-scheme iframes under an http parent, browser- and renderer-initiated, commit without origin-mismatch checks firing; blob URL fetches from the data: frame work; spec/api-protocol-spec.ts (178) and the frame-related subset of spec/chromium-spec.ts pass. I did not find an app-observable difference from the old behavior in that probing; the point is to stop diverging from upstream for a scheme the patch was never about.

Checklist

Release Notes

Notes: none

Backports

44-x-y
Pending
Waiting for a manual backport
45-x-y
In-flight
PR Number
#53681
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