Open Bug 1113954 Opened 10 years ago Updated 2 years ago

console defines commands that pollute the namespace, can confuse developer during debugging

Categories

(DevTools :: Console, defect, P3)

35 Branch
x86_64
Windows 8.1
defect

Tracking

(Not tracked)

People

(Reporter: hsteen, Unassigned)

Details

Per Mike's observation in https://bugzilla.mozilla.org/show_bug.cgi?id=1083932#c5 having 'cd' bound to some built-in console function during debugging is confusing.

Opera Dragonfly solved this by implementing console commands with a comment syntax. Instead of cd() you would type // cd() into the console.

To test this, go to example.com and open dev tools / console tab. Type "cd" (no quotes) and press enter. You should get a warning about cd not being defined.
This bug requires changes in the console, not the debugger, so I'm moving it there.
Component: Developer Tools: Debugger → Developer Tools: Console
Well, about the command-as-comments, I have some concerns. With Firebug.next, we would have the command editor, and pasting functions with comments would be common...

FWIW, Firebug ideas related to that :
- define a "firebug" object with firebug commands in it: https://code.google.com/p/fbug/issues/detail?id=5810
- Commands in Firebug (using a ":" prefix): https://code.google.com/p/fbug/issues/detail?id=4176

Another idea I have just got: what about adding |"force commands";| and |"unforce commands";| statements (*with* the quotes, just like "use strict"), that will enable a prioritized mode for commands over the debuggee environment?
The statement would necessarily be at the top of the evaluated expression (for simplicity of implementation). What do you think?

Florent
There is a long-standing plan to combine GCLI and web console, which would result in using a prefix to submit GCLI commands. Perhaps we could move console helpers to that prefix at that time.
Product: Firefox → DevTools
For the record, we moved some of gcli commands into the console, where we use `:` to trigger them (:screenshot, :help).
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.