Changeset 242929 in webkit


Ignore:
Timestamp:
Mar 13, 2019 6:35:35 PM (5 years ago)
Author:
Devin Rousso
Message:

Web Inspector: Debugger: pausing in an inline script on a page with a URL query creates an Extra Script
https://bugs.webkit.org/show_bug.cgi?id=195705
<rdar://problem/48853820>

Reviewed by Antoine Quint.

  • UserInterface/Models/Script.js:

(WI.Script.prototype._resolveResource):
If the page's URL has a query parameter, the payload we receive for any inline <script>s
doesn't include the query parameter as part of its URL. As such, if there isn't an existing
resource with a URL that exactly matches the URL of the script and if the URL of the main
resource for the script's target starts with the URL of the script, we assume that the
script "belongs" to the target's main resource and associate the script with it as such.

Location:
trunk/Source/WebInspectorUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r242918 r242929  
     12019-03-13  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Debugger: pausing in an inline script on a page with a URL query creates an Extra Script
     4        https://bugs.webkit.org/show_bug.cgi?id=195705
     5        <rdar://problem/48853820>
     6
     7        Reviewed by Antoine Quint.
     8
     9        * UserInterface/Models/Script.js:
     10        (WI.Script.prototype._resolveResource):
     11        If the page's URL has a query parameter, the payload we receive for any inline <script>s
     12        doesn't include the query parameter as part of its URL. As such, if there isn't an existing
     13        resource with a URL that exactly matches the URL of the script and if the URL of the main
     14        resource for the script's target starts with the URL of the script, we assume that the
     15        script "belongs" to the target's main resource and associate the script with it as such.
     16
    1172019-03-13  Keith Rollin  <krollin@apple.com>
    218
  • trunk/Source/WebInspectorUI/UserInterface/Models/Script.js

    r236783 r242929  
    277277        } catch { }
    278278
     279        if (!this.isMainResource()) {
     280            for (let frame of WI.networkManager.frames) {
     281                if (frame.mainResource.type === WI.Resource.Type.Document && frame.mainResource.url.startsWith(this._url))
     282                    return frame.mainResource;
     283            }
     284        }
     285
    279286        return null;
    280287    }
Note: See TracChangeset for help on using the changeset viewer.