Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: df88b37022bb15f2a79cf9f70731ecb2f4204454
      
https://github.com/WebKit/WebKit/commit/df88b37022bb15f2a79cf9f70731ecb2f4204454
  Author: Yury Semikhatsky <[email protected]>
  Date:   2026-07-01 (Wed, 01 Jul 2026)

  Changed paths:
    A LayoutTests/inspector/page/resources/scriptless-subframe.html
    A 
LayoutTests/inspector/page/setBootstrapScript-runs-once-per-navigation-expected.txt
    A 
LayoutTests/inspector/page/setBootstrapScript-runs-once-per-navigation.html
    M Source/WebCore/inspector/agents/InspectorPageAgent.cpp
    M Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp
    M Source/WebCore/inspector/agents/page/PageRuntimeAgent.h

  Log Message:
  -----------
  [Web Inspector] didClearWindowObject is dispatched twice for script-less 
frames
https://bugs.webkit.org/show_bug.cgi?id=318294

Reviewed by Devin Rousso.

PageRuntimeAgent forces a frame's main-world global object to be created
so script-less frames get an execution context. That creation re-enters
didClearWindowObjectInWorld, so Runtime.executionContextCreated was
dispatched twice and Page bootstrap scripts ran twice. Track the forced
dispatch on PageRuntimeAgent and skip the re-entrant one.

Test: inspector/page/setBootstrapScript-runs-once-per-navigation.html

* LayoutTests/inspector/page/resources/scriptless-subframe.html: Added.
* 
LayoutTests/inspector/page/setBootstrapScript-runs-once-per-navigation-expected.txt:
 Added.
* LayoutTests/inspector/page/setBootstrapScript-runs-once-per-navigation.html: 
Added.
* Source/WebCore/inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::didClearWindowObjectInWorld):
* Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp:
(WebCore::PageRuntimeAgent::frameNavigated):
(WebCore::PageRuntimeAgent::didClearWindowObjectInWorld):
* Source/WebCore/inspector/agents/page/PageRuntimeAgent.h:

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



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

Reply via email to