Open Bug 1560823 Opened 6 years ago Updated 1 year ago

Opening Development Tools from command line with Firefox open does not work

Categories

(DevTools :: General, enhancement, P3)

67 Branch
enhancement

Tracking

(firefox67 affected, firefox68 affected, firefox69 affected)

Tracking Status
firefox67 --- affected
firefox68 --- affected
firefox69 --- affected

People

(Reporter: ngroot95, Unassigned)

Details

Attachments

(1 obsolete file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36

Steps to reproduce:

(Windows 10 x64 Version 1803, Firefox Version 67.0.4 64-bit)

  1. Start Firefox
  2. Start Command Prompt (cmd.exe)
  3. In Command Prompt, navigate to the Firefox installation folder. In my case with the following command:

cd C:\Program Files\Mozilla Firefox

  1. Press ENTER.

  2. In Command Prompt, enter the following command:

firefox -devtools

  1. Press ENTER.

Actual results:

A new Firefox window opened without the Development Tools open.
Having no instance of Firefox running (skipping step 1.) results in no issue: the Development Tools window opens in a new Firefox window.

Expected results:

A new Firefox window should open with the Development Tools window open.

I tried to reproduce this issue on Firefox 67.0.4 and on Firefox 69.0a1 on Windows 10 x64 and in case you have Firefox already running trying to run "firefox -devtools" command will open a new window but without "Developer Tools".

Status: UNCONFIRMED → NEW
Component: Untriaged → Startup and Profile System
Ever confirmed: true
Product: Firefox → Toolkit
Component: Startup and Profile System → General
Product: Toolkit → DevTools

(In reply to Dave Townsend [:mossop] (he/him) from comment #2)

Not sure why, but this appears to be intentional: https://searchfox.org/mozilla-central/source/devtools/startup/DevToolsStartup.jsm#275

Good find, thank you. I also don't see why it is this way. When building scripts/automate certain tasks this can be quite annoying. I hope this behavior could be changed.

The priority flag is not set for this bug.
:pbro, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(pbrosset)

Unfortunately the link in comment 2 isn't a permalink to a specific revision and I think the file has changed since that comment was posted.
I'm guessing this was supposed to point to somewhere around here: https://searchfox.org/mozilla-central/rev/4436573fa3d5c4311822090e188504c10c916c6f/devtools/startup/DevToolsStartup.jsm#320-329
where we seem to only handle the devtools flag for the initial launch.

I have a feeling this can be changed now, but let me ping Julian.

Flags: needinfo?(pbrosset) → needinfo?(jdescottes)
Priority: -- → P3

Per https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#-devtools

Start with native Developer Tools opened.

We don't support to open devtools on existing windows via command line args. I'm removing the defect flag, unless there's any documentation that contradicts this?

If we want to support it we need to be careful about only opening devtools on the next window ready and not attaching all DevTools related events. This is why we only do part of the logic on initial launch. See https://bugzilla.mozilla.org/show_bug.cgi?id=1413246

Type: defect → enhancement
Flags: needinfo?(jdescottes)

This MDN page seems slightly outdated, so here's the relevant output from --help

> ./firefox --help
Usage: ./firefox [ options ... ] [URL]
       where options include:

  --g-fatal-warnings Make all warnings fatal

Firefox options
  -h or --help       Print this message.
  -v or --version    Print Firefox version.
  [...]
  --devtools         Open DevTools on initial load.
  [...]
Severity: normal → S3
Attachment #9385959 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: