Changeset 259741 in webkit
- Timestamp:
- Apr 8, 2020, 12:02:28 PM (6 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
UserInterface/Main.html (modified) (1 diff)
-
UserInterface/Models/Resource.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r259740 r259741 1 2020-04-08 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Uncaught Exception: undefined is not an object (evaluating 'this._target.NetworkAgent.getResponseBody') 4 https://bugs.webkit.org/show_bug.cgi?id=210168 5 6 Reviewed by Timothy Hatcher. 7 8 If a script is loaded by the main page and a `Worker`, the `WI.Script` from the `Worker` 9 will be associated with the `WI.Resource` from the main page, the call stack in the Sources 10 Tab will use the `WI.Resource` over the `WI.Script`, but the `WI.Target` for a `Worker` does 11 not have a `NetworkAgent` or `PageAgent`. As such, inside `WI.Resource`, if the `_target` is 12 a `WI.TargetType.Worker`, use the `DebuggerAgent`. 13 14 * UserInterface/Models/Resource.js: 15 (WI.Resource.prototype.requestContentFromBackend): 16 17 * UserInterface/Main.html: 18 Drive-by: remove unnecessary `<script>`. 19 1 20 2020-04-08 Devin Rousso <drousso@apple.com> 2 21 -
trunk/Source/WebInspectorUI/UserInterface/Main.html
r259173 r259741 894 894 <script src="Controllers/WorkerManager.js"></script> 895 895 896 <script src="Workers/Formatter/FormatterContentBuilder.js"></script>897 898 896 <script src="Controllers/DiagnosticController.js"></script> 899 897 <script src="Controllers/DiagnosticEventRecorder.js"></script> -
trunk/Source/WebInspectorUI/UserInterface/Models/Resource.js
r259141 r259741 846 846 return specialContentPromise; 847 847 848 // If we have the requestIdentifier we can get the actual response for this specific resource. 849 // Otherwise the content will be cached resource data, which might not exist anymore. 850 if (this._requestIdentifier) 851 return this._target.NetworkAgent.getResponseBody(this._requestIdentifier); 852 853 // There is no request identifier or frame to request content from. 854 if (this._parentFrame) 855 return this._target.PageAgent.getResourceContent(this._parentFrame.id, this._url); 848 if (this._target.type === WI.TargetType.Worker) { 849 console.assert(this.isScript); 850 let scriptForTarget = this.scripts.find((script) => script.target === this._target); 851 console.assert(scriptForTarget); 852 if (scriptForTarget) 853 return scriptForTarget.requestContentFromBackend(); 854 } else { 855 // If we have the requestIdentifier we can get the actual response for this specific resource. 856 // Otherwise the content will be cached resource data, which might not exist anymore. 857 if (this._requestIdentifier) 858 return this._target.NetworkAgent.getResponseBody(this._requestIdentifier); 859 860 // There is no request identifier or frame to request content from. 861 if (this._parentFrame) 862 return this._target.PageAgent.getResourceContent(this._parentFrame.id, this._url); 863 } 856 864 857 865 return Promise.reject(new Error("Content request failed."));
Note:
See TracChangeset
for help on using the changeset viewer.