Opened 11 years ago

Closed 10 years ago

#8103 closed defect (wontfix)

Only use firebug lite for browsers without a native console

Reported by: James Burke Owned by: James Burke
Priority: high Milestone: future
Component: Core Version: 1.2.1
Keywords: Cc: cb1kenobi
Blocked By: Blocking:

Description

IE8 now has a developer tool console. So does Safari. Only use firebug lite for browsers without a native console object. This should help IE8 in general since the firebug lite in the page shows up in a weird place on the page.

Change History (5)

comment:1 Changed 11 years ago by Adam Peller

[15719] seems to have broken Safari3 (see themeTester)

comment:2 Changed 11 years ago by James Burke

Milestone: 1.3future

This needs more thought. console.debug is not something generically supported across console impls. Ideally we should eliminate console.debug use, particularly since the build system can strip console calls.

Perhaps reconsider this as a general rethink of what services dojo._firebug should provide.

comment:3 Changed 10 years ago by cb1kenobi

Cc: cb1kenobi added

We should devise a new way a detecting if the console is present and do it soon.

Right now we do the following in firebug.js:

if(
   !window.firebug &&								// Testing for mozilla firebug lite 
   !dojo.config.useCustomLogger &&
	!dojo.isAIR &&									// isDebug triggers AIRInsector, not Firebug
    (!dojo.isMoz || 								// if not Firefox, there's no firebug
	(dojo.isMoz && !("console" in window)) || 		// Firefox, but Firebug is not installed.
	(dojo.isMoz && !(window.loadFirebugConsole || console.firebug)) 	// Firefox, but Firebug is disabled (1.2 check, 1.0 check)
)){

I don't know the specifics of IE8's console or Safari's web inspector console, but I know Appcelerator Titanium uses WebKit? and exposes the web inspector. I want to disable Firebug Lite for Titanium and right now the only way to prevent it is to put useCustomLogger:true in the djConfig.

We could sniff for Titanium in hostenv_browser.js with something like

d.isTitanium = parseFloat(nua.split("Titanium/")[1]) || undefined;

And then in Firebug and a "&& !dojo.isTitanium", but that is only making the issue worse. It doesn't make sense to do all this guessing... we need a better way to sniff if the console is present.

After messing around with Titanium's console, I have not found any way yet to distinguish if the console object is completely Firebug compatible without manually checking that each function exists.

Honestly, we could probably just check if !dojo.config.useCustomLogger && !dojo.isAIR && !window.console, then allow Firebug Lite to be defined. This check though needs to be inserted into bootstrap.js instead of firebug.js since we need to check the existance of a console object prior to the bootstrap generating the Firebug stub functions.

I don't mind doing the some of the busy work, so let's get a conversation started and develop a plan so we can address this issue.

comment:4 Changed 10 years ago by Mike Wilcox

Can this be closed as a result of: http://bugs.dojotoolkit.org/ticket/9902

comment:5 Changed 10 years ago by James Burke

Resolution: wontfix
Status: newclosed

Yes, we can close this. I was hoping we could simplify the console code in Dojo, but after the extensive discussions on list, we need to keep the current stuff in there because of backwards compat, as much as I would like to remove it.

Note: See TracTickets for help on using tickets.