Closed Bug 1675332 Opened 4 years ago Closed 4 years ago

Make `--headless --jsdebugger` launch a Browser Toolbox that is not itself headless

Categories

(DevTools :: Debugger, defect)

defect

Tracking

(firefox84 fixed)

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: nalexander, Assigned: nalexander)

References

Details

Attachments

(2 files)

Right now, the MOZ_HEADLESS environment variable is set by the --headless process and inherited by the launched Browser Toolbox process, hiding the debugger UI. This ticket tracks allowing to see the JS debugger when running under --headless by explicitly removing the MOZ_HEADLESS variable from the environment.

To do this, a small tweak to Subprocess.jsm is needed to allow removing environment variables. Using null to signal "removal", distinct from undefined for "ignored", seems to be an accepted idiom in these types of JS interfaces, so I'll post a patch that starts with that approach.

Component: Application Update → Debugger
Product: Toolkit → DevTools

This small tweak makes it ergonomic to remove variables from the
inherited environment. Using null to signal "removal", distinct
from undefined for "ignored", seems to be an accepted idiom in these
types of JS interfaces.

Assignee: nobody → nalexander
Status: NEW → ASSIGNED

Before this commit, the MOZ_HEADLESS environment variable was set by
the --headless process and inherited by the launched Browser Toolbox
process, hiding the debugger UI. This commit allows to launch the JS
debugger when running under --headless by explicitly removing the
MOZ_HEADLESS variable from the environment. To do this, a small
tweak to Subprocess.jsm is used that allows null to signal
"removal", distinct from undefined for "ignored".

While here I prefixed the output from the launched Browser Toolbox
process, which helps visually distinguish warnings, etc; and I also
corrected a typo that I stumbled across.

Depends on D95896

Pushed by nalexander@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/edb1f046f3f5
Pre: Make `VALUE: null` remove env vars in Subprocess.jsm. r=kmag
https://hg.mozilla.org/integration/autoland/rev/19ed765b7623
Make `--headless --jsdebugger` launch a headed Browser Toolbox. r=emalysz
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
Blocks: 1686344
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: