Add a context menu item to open the JS scripts in DevTools debugger#5295
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5295 +/- ##
==========================================
- Coverage 86.07% 85.94% -0.13%
==========================================
Files 311 311
Lines 29657 29710 +53
Branches 8196 8211 +15
==========================================
+ Hits 25528 25535 +7
- Misses 3547 3586 +39
- Partials 582 589 +7 ☔ View full report in Codecov by Sentry. |
6248413 to
2184636
Compare
d8cd9ec to
9a4fb2e
Compare
|
When I tried it it worked sometimes but sometimes it didn't. I'm not sure how to debug, I don't see any useful message in the Browser Console... When it doesn't work, it still opens the devtools, but not the file itself. Do you have an idea of where it could come from? Also I noticed that sometimes the function for an addon appears, we also show the item "show function in devtools" for these, but it should probably be filtered out. |
julienw
left a comment
There was a problem hiding this comment.
Thanks, this looks good to me. I think we can figure out the cases where it doesn't work well in follow-ups.
There's one comment that should be simple (check that the tabID is present when rendering too).
Also do you think you could do a test that actually clicks the menu item? I see you added a web channel mock but don't use it at the moment. This would exercise the webchannel code, even though I know this isn't perfect because this is just a mock.
Also just a note about my previous comment:
Also I noticed that sometimes the function for an addon appears, we also show the item "show function in devtools" for these, but it should probably be filtered out.
After discussing with @ochameau in the office, he thinks we should keep it, and display it in the debugger. There's a setting controlling this, off by default for now, but that will be toggled to on by default later... Good to discuss in a dedicated bug, I think :-)
| const fileName = | ||
| filePath && | ||
| parseFileNameFromSymbolication(filePath).path.match(/[^\\/]+$/)?.[0]; | ||
| const showOpenDebuggerItem = |
There was a problem hiding this comment.
should we check for the tabId here as well? I think we should (and an additional test should check it).
There was a problem hiding this comment.
I think this happens when debugging Firefox frontend code for example.
There was a problem hiding this comment.
Yeah, that's right. Updated here to check the tabId as well.
9a4fb2e to
5e5a7ca
Compare
|
Thanks for the review!
Hmm, that might be the case where we don't have the browserId, but it's worth checking it still. I will look at it as a follow-up.
Not so sure about this one. This case might be when we have tabId, but maybe when we don't have the proper script url, or some other issue. I will look into that as well.
To be honest, I don't think adding this test would give us any more test coverage. As like you said, it would mostly test the moch webchannel. And the rest of that code is only the plumping of variables to the webchannel without touching the values. It doesn't have any logic in them, so I would prefer to skip adding a test for this right now. If we add some logic to these code paths, then it makes sense to add some tests to excersize these behaviors.
Yeah, sure I can file a bug for this one. |
Updates: [Julien Wajsberg] Some more small refactorings (#5320) [Markus Stange] Pass the correct sample index offset to getTimingsForCallNodeIndex for the flame graph tooltip. (#5328) [Nisarg Jhaveri] Update docs to include Android Studio/Simpleperf trace file support (#5309) [Markus Stange] Don't pass the preview filtered thread to getTimingsForPath/CallNodeIndex. (#5329) [Nazım Can Altınova] Add a "Sample timestamp" field to the sample tooltip in timeline (#5322) [Markus Stange] Reduce confusion between call tree summary strategy aware samples and regular samples (#5330) [Markus Stange] Rename this getCounter selector to getCounters. (#5337) [Markus Stange] Make sample indexes compatible between the unfiltered and (preview) filtered call tree summary strategy samples when using an allocation strat> [Markus Stange] Remove some code that uses the preview filtered thread (#5336) [Markus Stange] Remove getMarkerSchemaName special cases - look up marker schemas from data.type and nothing else (#5293) [Markus Stange] Remove the makeProfileSerializable step - make the raw in-memory profile match the format that's stored in the file (#5287) [Nicolas Chevobbe] Adapt FilterNavigatorBar to High Contrast Mode. (#5257) [Nicolas Chevobbe] Adapt Tracks to High Contrast Mode. (#5252) [Markus Stange] Adjust string index fields in markers when merging threads (#5344) [Theodoros Nikolaou] Localize title and aria label in ProfileName (#5345) [Julien Wajsberg] Adapt time-slice selection in High Contrast Mode. (#5259) [Markus Stange] Make stackTable (sub)category derived data (#5342) [Markus Stange] Compute cpuRatio values when computing the derived thread (#5288) [Nazım Can Altınova] Add a context menu item to open the JS scripts in DevTools debugger (#5295) Also thanks to our localizers: el: Jim Spentzos fr: Théo Chevalier it: Francesco Lodolo [:flod] zh-TW: Pin-guang Chen
This is a deploy preview for Bug 1925391.
It adds a context menu item for call node context menu to open the JS source code in the devtools debugger directly if the tab and browser connection still exists.
Unfortunately it's not possible to simply give a deploy preview. It needs to be a newly captured profile since it relies on the browser web channel connection to be alive.
The recent Firefox Nightly should have the web channel now. So you use any nightly version that includes the patch from Bug 1925391. Here's how to test it locally:
about:config, changedevtools.performance.recording.ui-base-urltohttps://deploy-preview-5295--perf-html.netlify.app.about:profilingand enable theJS Execution Tracingfeature.Show the function in DevTools.