Implement console.debug() (was: Navigation broken on Citytv website)

VERIFIED FIXED in Firefox 5

Status

()

Firefox
Developer Tools
VERIFIED FIXED
7 years ago
6 years ago

People

(Reporter: IU, Assigned: rc)

Tracking

({dev-doc-complete, regression})

Trunk
Firefox 5
x86
Windows XP
dev-doc-complete, regression
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(blocking2.0 -)

Details

(Whiteboard: [console-3][has-review], URL)

Attachments

(1 attachment)

(Reporter)

Description

7 years ago
On the citytv.com/vancouver website, there 6 rectangular blocks representing 6 different shows.  Normally, hovering them changes the banner to one corresponding to the block hovered (along with an arrow pointing to the banner).  The block should also be clickable.

Since the Nov 17 nightly, this no longer works.  The site works properly in both Google Chrome and IE 8.

With the Nov 17 nightly, the following also appears in Error Console:

Error: Permission denied to access property 'debug'
Source File: http://tv.citytv.com/scripts/com.rogers.TVSchedule.CityScheduleWidget.js
Line: 194

With recent nightlies, the Error Console message is instead:

Error: console.debug is undefined
Source File: http://tv.citytv.com/scripts/com.rogers.TVSchedule.CityScheduleWidget.js
Line: 194

Regression pushlog:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=a42e9b001bc8&tochange=ad227939db82

I therefore suspect this to be a fallout of bug 587734.
(Reporter)

Updated

7 years ago
Blocks: 587734
blocking2.0: --- → ?
Keywords: regression

Updated

7 years ago
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 614350
(Reporter)

Comment 2

7 years ago
bug 614350 did not fix this.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
You're still getting the same error? I don't see how that could possibly be happening...
(Reporter)

Comment 4

7 years ago
Yes.  Comment 0 still reproducible -- even with the Dec 11 nightly.
(Assignee)

Comment 5

7 years ago
confirmed ([expletive deleted]!).

The line in question is doing an apply like so:

/**
 * Firebug based console logging
 */
com.rogers.TVSchedule.CityScheduleWidget.prototype.log = function()
{
	if (this.config.debug && window.console)
		console.debug.apply(console, arguments);
};

I can reproduce this in the JSTerm of our console by doing something like:

console.debug.apply(console, ["hi"])

and get

TypeError: console.debug is undefined

I wonder if this is a bug in __noSuchMethod__ ?
(Assignee)

Updated

7 years ago
Depends on: 618702
console.debug isn't being called in that case, so not a bug in __noSuchMethod__. We can't really fix that kind of bustage without actually replicating firebug's console entirely, which I don't think we want to do. Tech Evangelism might be the best way forward here... hopefully this isn't reflective of a widespread pattern.
(Assignee)

Comment 7

7 years ago
ah, ok. Read a little more about __noSuchMethod__ and that seems to be the case.

Looks like we're either back to implementing the known Console API methods individually (as stubs or fully) to make problems like this one go away.
Not going to hold the release on websites leaving debugging code laying around, blocking-.
blocking2.0: ? → -
(Assignee)

Comment 9

7 years ago
I think that's fair.

I may have a solution with a Proxy-based catch-all, but need a bit more experimentation. Will post a patch when ready.

Comment 10

6 years ago
I'm not convinced this is a devtools bug.

Updated

6 years ago
Whiteboard: [console-3]

Updated

6 years ago
Keywords: regression
(Reporter)

Comment 11

6 years ago
(In reply to comment #10)
> I'm not convinced this is a devtools bug.

Why not? If I make a local copy of the affected content and edit http://tv.citytv.com/scripts/com.rogers.TVSchedule.CityScheduleWidget.js, changing the following line:
    debug: true

to:
    debug: false

then everything works.

Every other major browser renders that page without issue.  Only Firefox 4 has problems.
(Reporter)

Updated

6 years ago
Keywords: regression
(Assignee)

Comment 12

6 years ago
(In reply to comment #11)
> (In reply to comment #10)
> > I'm not convinced this is a devtools bug.
> 
> Why not? If I make a local copy of the affected content and edit
> http://tv.citytv.com/scripts/com.rogers.TVSchedule.CityScheduleWidget.js,
> changing the following line:
>     debug: true
> 
> to:
>     debug: false
> 
> then everything works.
> 
> Every other major browser renders that page without issue.  Only Firefox 4 has
> problems.

And you think it's OK for CityTV to ship a production version of their website with debugging turned on?

If you click on "shows" the widget works fine there. Looks like they forgot to disable debugging on their main page. They're also not detecting that there's a console.debug object for them to apply with. In short, there's a lot broken on that webpage and they should fix it.

All that said, I'm going to convert this bug to Implement console.debug and that should make the bug go away when it lands.
Blocks: 644596
Summary: Navigation broken on Citytv website → Implement console.debug() (was: Navigation broken on Citytv website)
(Assignee)

Comment 13

6 years ago
Created attachment 522467 [details] [diff] [review]
[checked-in] console.debug

most basic debug support imaginable. The function itself is pretty weakly defined, basically behaves as log().

"console.debug(object[, object, ...])

Writes a message to the console, including a hyperlink to the line where it was called. "

from http://getfirebug.com/wiki/index.php/Console_API
Assignee: nobody → rcampbell
Status: REOPENED → ASSIGNED
Attachment #522467 - Flags: review?(ddahl)

Comment 14

6 years ago
(In reply to comment #13)

> Writes a message to the console, including a hyperlink to the line where it was
> called. "

Are you adding the hyperlink bit in a followup bug? Also , 2 more things that would make this awesome would be another color for debug messages and a filter menu button - all of which should maybe come in a fx 6  patch?

Comment 15

6 years ago
Comment on attachment 522467 [details] [diff] [review]
[checked-in] console.debug

If we are just mirroring log, this is fine. this should cut down the bug reports as I imagine debug() is the next heavily used api after what we have so far.
Attachment #522467 - Flags: review?(ddahl) → review+
(Assignee)

Comment 16

6 years ago
(In reply to comment #14)
> (In reply to comment #13)
> 
> > Writes a message to the console, including a hyperlink to the line where it was
> > called. "
> 
> Are you adding the hyperlink bit in a followup bug? Also , 2 more things that
> would make this awesome would be another color for debug messages and a filter
> menu button - all of which should maybe come in a fx 6  patch?

added bug 646025 to handle the file location.

Not sure we need another color to distinguish debug from log. They appear to be synonymous with each other. I will add a filter option bug as well.

Thanks for the review!
(Assignee)

Comment 17

6 years ago
Comment on attachment 522467 [details] [diff] [review]
[checked-in] console.debug

review request for consoleAPI bits for sicking.
Attachment #522467 - Flags: review?(jonas)
(Assignee)

Updated

6 years ago
Blocks: 646028
(Assignee)

Comment 18

6 years ago
added bug 646028 to add the filter button.
(Assignee)

Updated

6 years ago
Attachment #522467 - Flags: review?(gal)
(Assignee)

Comment 19

6 years ago
Andreas, was just looking at bug 634156 and thought I'd try to sneak a quick review through before you made that change. We'd like to add "debug" to this list of functions.
Comment on attachment 522467 [details] [diff] [review]
[checked-in] console.debug

>diff --git a/dom/base/ConsoleAPI.js b/dom/base/ConsoleAPI.js
>+      debug: function CA_debug() {
>+        self.notifyObservers(id, "log", arguments);
>+      },

If you're passing "log" here...

>diff --git a/toolkit/components/console/hudservice/HUDService.jsm b/toolkit/components/console/hudservice/HUDService.jsm
>@@ -139,16 +139,17 @@ const SEVERITY_INFO = 2;
> const SEVERITY_LOG = 3;
> 
> // A mapping from the console API log event levels to the Web Console
> // severities.
> const LEVELS = {
>   error: SEVERITY_ERROR,
>   warn: SEVERITY_WARNING,
>   info: SEVERITY_INFO,
>+  debug: SEVERITY_LOG,
>   log: SEVERITY_LOG,
> };

...then you don't need to add "debug" here, right? So either use "debug" above, or don't add "debug" to LEVELS.

r=me with that fixed.
Attachment #522467 - Flags: review?(jonas) → review+
(Assignee)

Comment 21

6 years ago
true enough. Thanks for the review!
(Assignee)

Comment 22

6 years ago
Comment on attachment 522467 [details] [diff] [review]
[checked-in] console.debug

checked into devtools:
http://hg.mozilla.org/projects/devtools/rev/3bbc2fd96c48
Attachment #522467 - Attachment description: console.debug → [in-devtools] console.debug
Attachment #522467 - Flags: review?(gal)
(Assignee)

Updated

6 years ago
Whiteboard: [console-3] → [console-3][has-review][in-devtools][merge-m-c]
(Assignee)

Comment 23

6 years ago
checked in a followup fix for the dom level test.

http://hg.mozilla.org/projects/devtools/rev/bc1ba93ee006
Location of the call is easy to track down from Components.stack. See the code from bug 585956.
(Assignee)

Comment 25

6 years ago
yep. Followup... bug 646025.
(Assignee)

Updated

6 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago6 years ago
Resolution: --- → FIXED
Whiteboard: [console-3][has-review][in-devtools][merge-m-c] → [console-3][has-review]
(Assignee)

Comment 26

6 years ago
Comment on attachment 522467 [details] [diff] [review]
[checked-in] console.debug

http://hg.mozilla.org/mozilla-central/rev/3bbc2fd96c48
Attachment #522467 - Attachment description: [in-devtools] console.debug → [checked-in] console.debug
(Assignee)

Comment 27

6 years ago
also, http://hg.mozilla.org/mozilla-central/rev/bc1ba93ee006 for test fix
(Reporter)

Comment 28

6 years ago
Thank you for providing a resolution for this.

Verified with http://hg.mozilla.org/mozilla-central/rev/a174b86200d6

Mozilla/5.0 (Windows NT 5.1; rv:2.2a1pre) Gecko/20110412 Firefox/4.2a1pre
Status: RESOLVED → VERIFIED

Updated

6 years ago
Target Milestone: --- → Firefox 5
(Assignee)

Comment 29

6 years ago
(In reply to comment #28)
> Thank you for providing a resolution for this.
> 
> Verified with http://hg.mozilla.org/mozilla-central/rev/a174b86200d6
> 
> Mozilla/5.0 (Windows NT 5.1; rv:2.2a1pre) Gecko/20110412 Firefox/4.2a1pre

You're welcome! Thanks for sticking with it. :)

Comment 30

6 years ago
doc folks: this page should mention console.debug (which is a synonym for console.log):

https://developer.mozilla.org/en/Using_the_Web_Console#The_console_object

and it may make sense to mention the addition here as well:

https://developer.mozilla.org/en/Firefox_5_for_developers#DOM
Keywords: dev-doc-needed
The documentation referenced in comment #30 has been updated.
Keywords: dev-doc-needed → dev-doc-complete
You need to log in before you can comment on or make changes to this bug.