Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cd17a97f62733e29cded46420a09863e6bcd5271
      
https://github.com/WebKit/WebKit/commit/cd17a97f62733e29cded46420a09863e6bcd5271
  Author: Zak Ridouh <[email protected]>
  Date:   2026-10-07 (Wed, 07 Oct 2026)

  Changed paths:
    A 
LayoutTests/http/tests/site-isolation/inspector/console/message-from-iframe-returning-to-process-expected.txt
    A 
LayoutTests/http/tests/site-isolation/inspector/console/message-from-iframe-returning-to-process.html
    A 
LayoutTests/http/tests/site-isolation/inspector/console/resources/silent.html
    M Source/WebCore/inspector/WebInjectedScriptManager.cpp
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/WebProcess/Inspector/FrameInspectorTarget.cpp
    M Source/WebKit/WebProcess/Inspector/FrameInspectorTarget.h

  Log Message:
  -----------
  [Site Isolation] Web Inspector: Crash when a frame target logs to the console 
after reconnecting
https://bugs.webkit.org/show_bug.cgi?id=326170
rdar://188834553

Reviewed by BJ Burg.

FrameInspectorTarget could dispatch frontend messages to a LocalFrame whose 
inspector controller it never
connected, for example after the frame returned to a process, or when the main 
frame's target connected
before CreateWebPage. Console.enable then ran without a CommandLineAPIHost, and 
the next console message
crashed.

Connect the channel to the current LocalFrame before dispatching, create the 
main frame's target after
CreateWebPage, and skip CommandLineAPI injection when there is no host.

Tests: 
http/tests/site-isolation/inspector/console/message-from-iframe-returning-to-process.html

* 
LayoutTests/http/tests/site-isolation/inspector/console/message-from-iframe-returning-to-process-expected.txt:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/console/message-from-iframe-returning-to-process.html:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/console/resources/silent.html: 
Added.
* Source/WebCore/inspector/WebInjectedScriptManager.cpp:
(WebCore::WebInjectedScriptManager::didCreateInjectedScript):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::initializeWebPage):
* Source/WebKit/WebProcess/Inspector/FrameInspectorTarget.cpp:
(WebKit::FrameInspectorTarget::connect):
(WebKit::FrameInspectorTarget::connectToCurrentFrame):
(WebKit::FrameInspectorTarget::sendMessageToTargetBackend):
* Source/WebKit/WebProcess/Inspector/FrameInspectorTarget.h:

Canonical link: https://commits.webkit.org/323032@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to