Bug 243606 - Dispatch GlobalObjectAvailable to subframes when adding user scripts
Summary: Dispatch GlobalObjectAvailable to subframes when adding user scripts
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Frames (show other bugs)
Version: WebKit Local Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-08-05 13:39 PDT by Wenqing Luo
Modified: 2022-08-11 11:27 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wenqing Luo 2022-08-05 13:39:05 PDT
Currently, when adding content script to only top frame, dispatchGlobalObjectAvailable won't be called for its subframes.
If user later calls runJavaScriptInFrameInScriptWorld directly in the subframe using the same world as the content script added to top frame, dispatchGlobalObjectAvailable won't be called for the subframe either.
In the end, objects that is registered in dispatchGlobalObjectAvailable callback won't be available for JavaScript that is executed by runJavaScriptInFrameInScriptWorld in subframe.
Comment 1 Wenqing Luo 2022-08-05 13:58:02 PDT
Pull request: https://github.com/WebKit/WebKit/pull/3059
Comment 2 EWS 2022-08-11 09:53:59 PDT
Committed 253337@main (4b458ff27f44): <https://commits.webkit.org/253337@main>

Reviewed commits have been landed. Closing PR #3059 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2022-08-11 09:55:18 PDT
<rdar://problem/98514341>
Comment 4 Wenqing Luo 2022-08-11 11:27:55 PDT
<rdar://problem/73500002>