RESOLVED WORKSFORME 272199
Web Inspector: JavaScript breakpoint location is sometimes incorrect when inspector first shows up
https://bugs.webkit.org/show_bug.cgi?id=272199
Summary Web Inspector: JavaScript breakpoint location is sometimes incorrect when ins...
Qianlang Chen
Reported 2024-04-04 16:58:49 PDT
Created attachment 470762 [details] Video demo: Breakpoint location is incorrect unless I click on the breakpoint If you set a breakpoint in some file at line L and column C, sometimes when that breakpoint first shows up in the source side bar on the left, the source location is displayed as 1:(global C ignoring new lines) instead of L:C. To reproduce (this is only one instance that the issue may reproduce, but it can happen on any website and any source file): 1. Go to https://search.brave.com 2. Open inspector's Sources tab 3. Make a breakpoint in the 0.DS3i2RRo.js file at line 5 4. Try reloading the page with the inspector open, navigating to another page and go back, reopening the inspector, and/or all of the above, to make the bug show up - Due to https://bugs.webkit.org/show_bug.cgi?id=272098 sometimes the breakpoint just doesn't show up in the sidebar. Change the file filter from "By Type" or "By Path" to the other one if it doesn't show up - When the bug happens, the breakpoint's location shows up as some 1:1507 instead of 22:9 See video demo. As you can see, the bug doesn't always happen.
Attachments
Video demo: Breakpoint location is incorrect unless I click on the breakpoint (4.25 MB, video/mp4)
2024-04-04 16:58 PDT, Qianlang Chen
no flags
Radar WebKit Bug Importer
Comment 1 2024-04-04 16:59:06 PDT
Qianlang Chen
Comment 2 2024-04-08 15:26:39 PDT
Update: The reason the breakpoint shows up as 1:1507 by default is because the source file 0.DS3i2RRo.js is "minified" and unformatted where all the code is on one line. Our inspector by default turns on a feature to prettify the code opened in the source editor, and that's what puts the breakpoint at 22:9 when I created it. The inspector is behaving correctly since the breakpoint in the unformatted file does belong to location 1:1507.
Qianlang Chen
Comment 3 2024-04-08 15:31:55 PDT
Also, the reason in the original bug description that the bug doesn't always happen is because I didn't highlight/select the source file 0.DS3i2RRo.js when I reloaded the inspector, so the source editor didn't show that source file so therefore didn't get to prettify it to have a different source location. Looking at it this way means it's also behaving expectedly and not flakily. Although, maybe this still shows that the behavior is somewhat confusing as I clearly didn't know this either before having investigating closely.
Note You need to log in before you can comment on or make changes to this bug.