Closed Bug 606793 Opened 10 years ago Closed 10 years ago

console.log() calls made before Web Console is opened are ignored

Categories

(DevTools :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 609890

People

(Reporter: webmaster, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (X11; Linux i686; rv:2.0b8pre) Gecko/20101023 Firefox/4.0b8pre
Build Identifier: Mozilla/5.0 (X11; Linux i686; rv:2.0b8pre) Gecko/20101023 Firefox/4.0b8pre

When I use the console object to debug JS code, I occasionally try to run the scripts with Firebug closed or the new Web Console closed.

However, in those cases the console object is not available. In Opera and Chrome it does not matter if I have the developer tools opened or not. Firefox behavior requires me to write endless checks:

if ( console ) console.log("foo");

I see this in 3.5, 3.6 and 4.0 Minefield on Linux. I have not tested Mac or Windows.

Reproducible: Always

Steps to Reproduce:
1. Run testcase, but do not open Firebug or the Web Console first.

Actual Results:  
Error is reported in the Error Console
Text "Error: console.log has not run" is not altered

Expected Results:  
The word "success" should be in the log, when it is opened after the script has run
The word "Success" should be visible on the page through the innerHTML on the 2nd line of the script.
Update.  ;)
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 587734
Hmm.  Though actually, there is nothing thrown, but no "success" in the log either...
Status: RESOLVED → REOPENED
Component: General → Developer Tools
Ever confirmed: true
QA Contact: general → developer.tools
Resolution: DUPLICATE → ---
Summary: console is undefined if Firebug or Web Console is not opened → console.log() calls made before Web Console is opened are ignored
bug 612658 and bug 609890 will fix this bug. So really this is a duplicate of bug 609890
Status: REOPENED → RESOLVED
Closed: 10 years ago10 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 609890
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.