Closed Bug 1538397 Opened 5 years ago Closed 5 years ago

Links to original files from the inspector go to the generated file at the given line

Categories

(DevTools :: Debugger, defect, P2)

defect

Tracking

(firefox68 fixed)

RESOLVED FIXED
Firefox 68
Tracking Status
firefox68 --- fixed

People

(Reporter: loganfsmyth, Assigned: bhackett1024)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Originally reported by Harald in https://bugzilla.mozilla.org/show_bug.cgi?id=1265327#c9 but I'm going to refile since this seems like a recent regression rather than specifically related to that old issue.

Made a simpler test case: https://amusing-dove.glitch.me/

STR:

Open Devtools
Inspect the first button which has an JS event attached
Click on the "ev" button to see the event popup
Click on "Open in Debugger" icon

I am unsure about this having just edge cases. I have not seen it working for any source mapped case.

Also from Harald:

To clarify:

Inline code preview in the events panel works and shows the correct handler. Resolving the filename and location works and shows the original location.

Clicking the link to the Debugger is what isn't working and send to the wrong file (generated file instead of original) with the correct original location. In the example, the original location of index.js:13 jumps to the generated file client.js:13.

Looks like this was regressed by https://bugzilla.mozilla.org/show_bug.cgi?id=1531826. We always prefer sourceId if it is available, but we aren't taking into account the fact that an event handler URL could be updated to point to an original file via the sourceMapService. This means that we end up linking to the original line and original URL, but we give the generated sourceId.

Brian, could you look into this since you're familiar with the inspector sourceActor logic?

Flags: needinfo?(bhackett1024)
Priority: -- → P2

The problem here is that the event tooltip is continuing to use the source actor for an event listener even after modifying its URI for a source map. The patch I just created clears the source actor when the source map service finds an original URL for the generated location. I'll try to write a test for this later.

Flags: needinfo?(bhackett1024)
Assignee: nobody → bhackett1024
Status: NEW → ASSIGNED
Has STR: --- → yes
Pushed by bhackett@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/21025c2c238d
Don't use source actor for event listeners with mapped sources, r=ochameau.
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: