Bug 312207

Summary: [Site Isolation] http/tests/misc/iframe-beforeunload-dialog-not-matching-ancestor-securityorigin.html doesn't log that it cannot dispatch a beforeUnload event to cross origin frames
Product: WebKit Reporter: Anthony Tarbinian <a.tarbinian>
Component: Page LoadingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Anthony Tarbinian
Reported 2026-04-13 16:51:14 PDT
When running http/tests/misc/iframe-beforeunload-dialog-not-matching-ancestor-securityorigin.html with site isolation enabled, WebKit does not log the following message: "Blocked attempt to show beforeunload confirmation dialog on behalf of a frame with different security origin." For context, the beforeUnload event gets run before a frame is about to be unloaded. The main use case for this event is to provide the user with a confirmation dialog to avoid closing the page and losing unsaved work. In FrameLoader::shouldClose, this message gets logged when a frame is about to be closed and WebKit is about to dispatch a beforeUnload message to each descendant frame of the navigating frame. However, in the current implementation it only collects LocalFrames to dispatch to. https://github.com/WebKit/WebKit/blob/723bdacf3bed4568822c50a02226c7fb115a487b/Source/WebCore/loader/FrameLoader.cpp#L3878-L3901 Under site isolation, cross-origin RemoteFrames were silently skipped and the console message was never emitted.
Attachments
Radar WebKit Bug Importer
Comment 1 2026-04-13 16:51:20 PDT
Anthony Tarbinian
Comment 2 2026-04-14 12:11:25 PDT
EWS
Comment 3 2026-05-19 10:02:51 PDT
Committed 313493@main (7254a2893c2e): <https://commits.webkit.org/313493@main> Reviewed commits have been landed. Closing PR #62756 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.