REGRESSION(r238168) Web Inspector: <iframe src=...> request does not show up in Netwo...
authorpecoraro@apple.com <pecoraro@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Apr 2019 21:28:24 +0000 (21:28 +0000)
committerpecoraro@apple.com <pecoraro@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Apr 2019 21:28:24 +0000 (21:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=193505
<rdar://problem/47325957>

Reviewed by Devin Rousso.

* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView):
(WI.NetworkTableContentView.prototype._handleFrameWasAdded):
Handle new frames by adding the frame's main resource.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244358 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js

index d9583c2..adb8fe4 100644 (file)
@@ -1,3 +1,16 @@
+2019-04-16  Joseph Pecoraro  <pecoraro@apple.com>
+
+        REGRESSION(r238168) Web Inspector: <iframe src=...> request does not show up in Network Tab
+        https://bugs.webkit.org/show_bug.cgi?id=193505
+        <rdar://problem/47325957>
+
+        Reviewed by Devin Rousso.
+
+        * UserInterface/Views/NetworkTableContentView.js:
+        (WI.NetworkTableContentView):
+        (WI.NetworkTableContentView.prototype._handleFrameWasAdded):
+        Handle new frames by adding the frame's main resource.
+
 2019-04-16  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: Uncaught Exception: TypeError: null is not an object (evaluating 'this._contentViewContainer.currentContentView.selectionPathComponents')
index 8523f0e..aa084a1 100644 (file)
@@ -162,6 +162,7 @@ WI.NetworkTableContentView = class NetworkTableContentView extends WI.ContentVie
         WI.Target.addEventListener(WI.Target.Event.ResourceAdded, this._handleResourceAdded, this);
         WI.Frame.addEventListener(WI.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
         WI.Frame.addEventListener(WI.Frame.Event.ResourceWasAdded, this._handleResourceAdded, this);
+        WI.Frame.addEventListener(WI.Frame.Event.ChildFrameWasAdded, this._handleFrameWasAdded, this);
         WI.Resource.addEventListener(WI.Resource.Event.LoadingDidFinish, this._resourceLoadingDidFinish, this);
         WI.Resource.addEventListener(WI.Resource.Event.LoadingDidFail, this._resourceLoadingDidFail, this);
         WI.Resource.addEventListener(WI.Resource.Event.TransferSizeDidChange, this._resourceTransferSizeDidChange, this);
@@ -1667,6 +1668,22 @@ WI.NetworkTableContentView = class NetworkTableContentView extends WI.ContentVie
         });
     }
 
+    _handleFrameWasAdded(event)
+    {
+        if (this._needsInitialPopulate)
+            return;
+
+        this._runForMainCollection((collection) => {
+            let frame = event.data.childFrame;
+            let mainResource = frame.provisionalMainResource || frame.mainResource;
+            console.assert(mainResource, "Frame should have a main resource.");
+            this._insertResourceAndReloadTable(mainResource);
+
+            console.assert(!frame.resourceCollection.size, "New frame should be empty.");
+            console.assert(!frame.childFrameCollection.size, "New frame should be empty.");
+        });
+    }
+
     _runForMainCollection(callback)
     {
         let currentCollection = this._activeCollection;
@@ -2057,7 +2074,7 @@ WI.NetworkTableContentView = class NetworkTableContentView extends WI.ContentVie
 
         if (this._hasURLFilter()) {
             for (let entry of this._activeCollection.entries)
-                this._checkURLFilterAgainstResource(entry.resource);            
+                this._checkURLFilterAgainstResource(entry.resource);
         }
     }