Open Bug 1893072 Opened 1 month ago Updated 1 month ago

Unclear how to remove directory root when not on original page where it was set

Categories

(DevTools :: Debugger, defect, P2)

Firefox 125
defect

Tracking

(Not tracked)

People

(Reporter: balloonguy123, Unassigned)

References

(Blocks 1 open bug)

Details

Steps to reproduce:

  1. Create 2 files, "a.js" which is blank, and "test.html" which contains the text: <script src="a.js"></script>
  2. Open test.html in a browser tab, open the web development tools, go to the debugger tab. In the source list pane, right click on file:// and select "Set directory root". Observe that "a.js" is still present in the source list pane
  3. Edit test.html so that it is blank.
  4. Reload the file in the browser. Observe that in the source list pane in the debugger tab, it says "This page has no sources"
  5. Close test.html in the browser
  6. In the browser now go to mozilla.org, open the web development tools and go to the debugger tab. In the source list pane, it says "This page has no sources".

Actual results:

The user has no indication as to why the sources are not being displayed when debugging mozilla.org when the page clearly contains javascript source files.

Even if the user realizes that the reason the sources are not showing is because the directory root was set to file:// in step 2, opening up test.html again will still not allow the user to clear the directory root unless the web page contains at least 1 javascript file.

Expected results:

When the directory root is set, the sources list pane should always show the UI element indicating what the root is, so that the directory root can be cleared from any page being debugged or if the page does not contain any sources.

A more pernicious example (and the actual scenario that affected me) is to 1. have the javascript file initially be in some sub-directory 2. set that sub-directory as the directory root 3. and then rename that directory.

I could not figure out why I could no longer see any sources on unrelated web pages and even on the same page where I know I had set the directory root.

We had Bug 1614028 for UI/UX improvements of the Directory Root feature, some good suggestions there.

See Also: → 1614028

In general, when we have a directory root set but no sources match (either because the folder is gone, or we are debugging another domain), we just show "This page has no sources" and there is no way to reset the directory root anymore.

This is not actually covered in the suggestions from Bug 1614028, and this sounds like a more urgent issue to fix.

Status: UNCONFIRMED → NEW
Ever confirmed: true

When we detect that no sources match the root filtering, we should just ignore the filter. This way people can keep debugging other domains, but when they go back to a domain with sources matching their root, the rule will still apply.

Severity: -- → S3
Priority: -- → P2
You need to log in before you can comment on or make changes to this bug.