Bug 207408

Summary: Web Inspector: injected scripts for the worlds cleared before normal are lost
Product: WebKit Reporter: Pavel Feldman <pfeldman>
Component: Web InspectorAssignee: Pavel Feldman <pfeldman>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: cdumez, dbates, ews-watchlist, inspector-bugzilla-changes, japhet, joepeck
Priority: P2    
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch none

Description Pavel Feldman 2020-02-07 14:30:58 PST
This is a follow up to https://bugs.webkit.org/show_bug.cgi?id=206110, please see the discussion there.

To recap,

I believe there is a subtle issue here - when didClearWindowObjectInWorld is called for the User world before it is called for the Normal world, subsequent call to clear the normal world will erase this injected script from the InjectedScriptManager through m_injectedScriptManager->discardInjectedScripts().

This can either be patched via the following change to the dispatchDidClearWindowObjectsInAllWorlds (that is somewhat hacky), or via going back to instrumenting only normal worlds and iterating over the remaining worlds within agents explicitly.
Comment 1 Pavel Feldman 2020-02-07 15:33:42 PST
Created attachment 390138 [details]
Patch
Comment 2 Joseph Pecoraro 2020-02-07 15:44:53 PST
Was this addressed by bug 207232?
https://bugs.webkit.org/show_bug.cgi?id=207232
Comment 3 Pavel Feldman 2020-02-07 16:40:39 PST
I believe it was! I missed it, thanks!

*** This bug has been marked as a duplicate of bug 207232 ***