Bug 142123

Summary: Web Inspector: sourceURL links should take you to the sourceURL resource, not original resource
Product: WebKit Reporter: Nikita Vasilyev <nvasilyev>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: inspector-bugzilla-changes, jonowells, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 150114    
Attachments:
Description Flags
Works in Chrome DevTools, broken in WebKit Inspector none

Description Nikita Vasilyev 2015-02-27 19:08:02 PST
Created attachment 247582 [details]
Works in Chrome DevTools, broken in WebKit Inspector

I received a report from a person using http://gaearon.github.io/react-hot-loader/, which in turn uses Webpack, a popular module loader. All the error locations in the WebKit Inspector console were either missing or wrong.

The problems is in the broken sourceURL.


index.html:

<script src="main.js"></script>
<script>
eval("console.log('eval worked');\n\
//# sourceURL=inline.js")
</script>


main.js:
console.log("sourceURL.js loaded");
//# sourceURL=external.js
Comment 1 Radar WebKit Bug Importer 2015-02-27 19:08:26 PST
<rdar://problem/19994525>
Comment 2 Joseph Pecoraro 2015-03-17 16:20:36 PDT
This is not a regression. The links work, they just don’t take you to the sourceURL named resource, and instead take you to the real resource. A valid location, just not the ideal location.

I may be wrong, but I believe in Chrome, v8 parses the sourceURL comment and uses that in the JavaScript engine. So it would pass to the frontend the sourceURL.

For us, any url:line:column our frontend gets we can compute where we want to show it.
Comment 3 Nikita Vasilyev 2016-08-03 14:45:43 PDT
Still relevant.

Reduction:
http://nv.github.io/webkit-inspector-bugs/142123_source-maps/
(So you don't have to copy/paste code from the bug description.)