| 410 | | var firebugConsoleCtor = null; |
|---|
| 411 | | var firebugContext = null; |
|---|
| 412 | | |
|---|
| 413 | | if (chromeWin && chromeWin.FirebugConsole) { |
|---|
| 414 | | firebugConsoleCtor = chromeWin.FirebugConsole; |
|---|
| 415 | | firebugContext = chromeWin.top.TabWatcher |
|---|
| 416 | | .getContextByWindow(unsafeContentWin); |
|---|
| 417 | | |
|---|
| 418 | | // on first load (of multiple tabs) the context might not exist |
|---|
| 419 | | if (!firebugContext) firebugConsoleCtor = null; |
|---|
| | 410 | if (!chromeWin) return null; |
|---|
| | 411 | var firebugConsole = null; |
|---|
| | 412 | var firebugContext = chromeWin.top.TabWatcher && |
|---|
| | 413 | chromeWin.top.TabWatcher.getContextByWindow(unsafeContentWin); |
|---|
| | 414 | // on first load (of multiple tabs) the context might not exist |
|---|
| | 415 | if (!firebugContext) return null; |
|---|
| | 416 | if (chromeWin.FirebugConsole) { // < Firebug 1.2 |
|---|
| | 417 | firebugConsole = |
|---|
| | 418 | new chromeWin.FirebugConsole(firebugContext, unsafeContentWin); |
|---|
| | 419 | } else if (chromeWin.Firebug.Console) { // >= Firebug 1.2 |
|---|
| | 420 | var firebug = chromeWin.Firebug.Console; |
|---|
| | 421 | firebugConsole = {}; |
|---|
| | 422 | var commands = ["log", "debug", "info", "warn", "error"]; |
|---|
| | 423 | commands.forEach(function(command) { |
|---|
| | 424 | firebugConsole[command] = function() { |
|---|
| | 425 | firebug.logFormatted.call( |
|---|
| | 426 | firebug, Array.slice(arguments), firebugContext, command |
|---|
| | 427 | ); |
|---|
| | 428 | } |
|---|
| | 429 | }); |
|---|