Closed Bug 1949019 Opened 19 days ago Closed 14 days ago

Focus is lost on the current line when debugging userscripts

Categories

(DevTools :: Debugger, defect, P2)

Firefox 137
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1837480

People

(Reporter: roman.deev06, Unassigned)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0

Steps to reproduce:

137.0a1 (2025-02-18) (aarch64)
(and 136.0b6)

  1. Install Violentmonkey https://addons.mozilla.org/firefox/addon/violentmonkey
  2. Install the userscript https://gist.github.com/deevroman/d07f0cc0f09cafd9e50ebf3908148bbc/raw/557c2e298d220f0d4ebcae756a8a394f095fb650/debugger-bug.user.js
  3. Open a debugger
  4. Open https://www.openstreetmap.org
  5. Reload the page.
    6.1 Drag the mouse over the inline preview of the html element (video_1_hover.mp4)
    6.2 Or start typing a CSS selector call to the console, for example: document.querySelector("body") (video_2_console.mp4)

Actual results:

The focus of the current debugger position is moved to another source file. The continue debugging buttons become inactive.

Expected results:

The focus doesn't move. The debugger buttons continue to work.

Attached video video_2_console.mp4
Attached video video_1_hover.mp4

The Bugbug bot thinks this bug should belong to the 'DevTools::Debugger' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Debugger
Product: Firefox → DevTools

Looks like the selected thread changes to content page main thread, which is not paused.
For the record you can switch back to the content script thread by selecting it on the right and then the UI should show that you are paused again.

I understand this and on video_2 I show it. But this is a regression, this has not happened before (I think it broke in 135 beta)

  1. What if I have more than a dozen extensions? (this is not a guess, I really have out a lot in Firefox Beta) What if the list of threads is collapsed? This greatly degrades the debugging UX.
  2. Why is it that when I return to the script thread, I can safely move the mouse over inline hints and not be moved to the main thread?

Nicolas will take a look, this seems related to the initialization of the inspector.
And it is indeed a regression because the content scripts used to be debugged from the main thread/

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(nchevobbe)
Priority: -- → P2

Note that it is the same issue as bug 1837480 comment 8

(In reply to Alexandre Poirot [:ochameau] from comment #7)

Note that it is the same issue as bug 1837480 comment 8

Indeed thanks, I will close this one and bump the priority of the other one.

Status: NEW → RESOLVED
Closed: 14 days ago
Duplicate of bug: 1837480
Flags: needinfo?(nchevobbe)
Resolution: --- → DUPLICATE

Bug 1837480 was closed for resolved and I can see that it should have been fixed in nightly / mac / deee0cffec33 / 138.0a1 / 20250306213030

But I still reproduce the steps described in this bug in 138.0a1 (2025-03-08) (aarch64)

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: