| Summary: | Web Inspector: Debugger: pausing in an inline script on a page with a URL query creates an Extra Script | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Devin Rousso <hi> | ||||||
| Component: | Web Inspector | Assignee: | Devin Rousso <hi> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | commit-queue, graouts, hi, inspector-bugzilla-changes, joepeck, webkit-bug-importer | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Attachments: |
|
||||||||
|
Description
Devin Rousso
2019-03-13 15:14:45 PDT
Created attachment 364581 [details]
Patch
Comment on attachment 364581 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=364581&action=review > Source/WebInspectorUI/UserInterface/Models/Script.js:280 > + let mainResource = this._target === WI.mainTarget ? WI.networkManager.mainFrame.mainResource : this._target.mainResource; Not sure if there's a coding style I don't know about, but technically `const` here would work since mainResource is not re-assigned. Comment on attachment 364581 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=364581&action=review >> Source/WebInspectorUI/UserInterface/Models/Script.js:280 >> + let mainResource = this._target === WI.mainTarget ? WI.networkManager.mainFrame.mainResource : this._target.mainResource; > > Not sure if there's a coding style I don't know about, but technically `const` here would work since mainResource is not re-assigned. The style that I've known for Web Inspector is that we only use `const` for things that won't change across executions. We use `const` almost like one would expect `static`. FWIW, `let` is also less characters than `const` :P Comment on attachment 364581 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=364581&action=review > Source/WebInspectorUI/UserInterface/Models/Script.js:283 > + if (this._target && !this.isMainResource()) { > + let mainResource = this._target === WI.mainTarget ? WI.networkManager.mainFrame.mainResource : this._target.mainResource; > + if (mainResource && mainResource.url.startsWith(this._url)) > + return mainResource; > + } Shouldn't this check each Frame's document resource URLs? What if this was a <script> in a sub-frame's document? Created attachment 364598 [details]
Patch
Comment on attachment 364598 [details] Patch Clearing flags on attachment: 364598 Committed r242929: <https://trac.webkit.org/changeset/242929> All reviewed patches have been landed. Closing bug. |