not resolved relative to script "src" as per v3 spec

Confirmed Issue #10288018 • Assigned to Newton J.

Details

Author
Darrell T.
Created
Dec 21, 2016
Privacy
This issue is public.
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

Steps to reproduce the problem:

  1. Create a local directory structure like so:

/index.html
/foo/bar.js
/foo/bar.js.map

  1. Edit the html file to include the javascript file like so:

<script type="text/javascript" src="/foo/bar.js"></script>

  1. Open the js file, and ensure it has a sourceMappingUrl directive, pointing to the map file, but also ensure the url has a leading / like so:

//# sourceMappingURL=/bar.js.map.

  1. Serve the directory up (browse the index.html page)

What is the expected behavior?
According to the Sourcemap V3 spec:

When the source mapping URL is not absolute, then it is relative to the generated code’s “source origin”.

If the generated code is associated with a script element and the script element has a “src” attribute, the “src” attribute of the script element will be the source origin.

This means I would expect edge to issue a request for the map file on /foo/bar.js.map

What went wrong?
Using fiddler (requests for source map files don’t appear to show up on the network tab) edge makes a request:

GET /foo.js.map HTTP/1.1

The leading “/” in the sourceMappingUrl appears to make edge treat resolve the url to the map file as relative to the site root rather than the source origin…

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Ibrahim O.”

      Changed Assigned To from “Ibrahim O.” to “Jacob R.”

      Changed Status to “Confirmed”

      Changed Assigned To from “Jacob R.” to “Newton J.”

    You need to sign in to your Microsoft account to add a comment.

    Sign in