Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Web Automation: WebAutomationSessionProxy.js gets injected more than …
…once sometimes

https://bugs.webkit.org/show_bug.cgi?id=157716
<rdar://problem/26287306>

Reviewed by Timothy Hatcher.

Whenever a script was injected into a non-normal world by a WebKit client,
the WebProcess's WebAutomationSessionProxy singleton would get a
notification that the window was cleared from the relevant frame.
This notification happens when creating the world's window shell for
the first time.

This code should ignore such notifications that originate from non-main world
contexts. Web Inspector's instrumentation already ignored this, but
the automation session notification comes in via a different WebKit2 layer.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):


Canonical link: https://commits.webkit.org/175872@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200950 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
burg committed May 16, 2016
1 parent f85e383 commit df2a148
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
21 changes: 21 additions & 0 deletions Source/WebKit2/ChangeLog
@@ -1,3 +1,24 @@
2016-05-16 Brian Burg <bburg@apple.com>

Web Automation: WebAutomationSessionProxy.js gets injected more than once sometimes
https://bugs.webkit.org/show_bug.cgi?id=157716
<rdar://problem/26287306>

Reviewed by Timothy Hatcher.

Whenever a script was injected into a non-normal world by a WebKit client,
the WebProcess's WebAutomationSessionProxy singleton would get a
notification that the window was cleared from the relevant frame.
This notification happens when creating the world's window shell for
the first time.

This code should ignore such notifications that originate from non-main world
contexts. Web Inspector's instrumentation already ignored this, but
the automation session notification comes in via a different WebKit2 layer.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):

2016-05-13 Dean Jackson <dino@apple.com>

Fix iOS Build.
Expand Down
Expand Up @@ -1579,7 +1579,9 @@ void WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld&

webPage->injectedBundleLoaderClient().didClearWindowObjectForFrame(webPage, m_frame, world);

if (auto automationSessionProxy = WebProcess::singleton().automationSessionProxy())

WebAutomationSessionProxy* automationSessionProxy = WebProcess::singleton().automationSessionProxy();
if (automationSessionProxy && world.isNormal())
automationSessionProxy->didClearWindowObjectForFrame(*m_frame);

#if HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
Expand Down

0 comments on commit df2a148

Please sign in to comment.