Test case here: https://gist.github.com/int3/5769221 debugger should display "foo", not "nothing here".
Works when I serve the directory via `python -m SimpleHTTPServer`, seems to only be failing for file:// urls.
Summary: absolute urls not working with sourcesContent and source maps still → absolute urls not working with sourcesContent and source maps in file:// urls
So after looking into this more, I believe we have the correct behavior. If our root is "file:///Users/fitzgen/scratch/int3/" then there is no hostname (file URIs don't have them) and the path is "/Users/fitzgen/scratch/int3/". Resolving the absolute path "/a" to our root, we replace the existing path with our new one and get "file:///a". This is maybe confusing for people who think that if they load "file:///Users/fitzgen/scratch/int3/foo.html" then "/foo.html" is the path, and "/Users/fitzgen/scratch/int3" is the hostname. But that isn't how file:// URIs work. However, when I open the same file URI in Chrome, it does source map the contents. Funny enough, it still names the source "file:///a". We could possibly fix this by not setting sourceRoot when we fetch the source map, and then we can special case this code if we want.
Created attachment 766113 [details] [diff] [review] v1 https://tbpl.mozilla.org/?tree=Try&rev=0a898dc75a21
Attachment #766113 - Flags: review?(dcamp)
See https://github.com/mozilla/source-map/pull/65 as well.
Is this what chrome is doing in that case?
(In reply to Dave Camp (:dcamp) from comment #5) > Is this what chrome is doing in that case? Yes
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 24
You need to log in before you can comment on or make changes to this bug.