Bug 142123 - Web Inspector: sourceURL links should take you to the sourceURL resource, not original resource
Summary: Web Inspector: sourceURL links should take you to the sourceURL resource, not...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 150114
  Show dependency treegraph
 
Reported: 2015-02-27 19:08 PST by Nikita Vasilyev
Modified: 2016-12-13 15:34 PST (History)
3 users (show)

See Also:


Attachments
Works in Chrome DevTools, broken in WebKit Inspector (59.22 KB, image/png)
2015-02-27 19:08 PST, Nikita Vasilyev
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.)