Skip to content

Commit

Permalink
(Issue 57) Duplicate console output
Browse files Browse the repository at this point in the history
  • Loading branch information
cadorn committed Jul 19, 2010
1 parent e794b7a commit 056d563
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions extension/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

- (Issue 57) Duplicate console output
- (Issue 136) Firebug 1.5X.0 Final won't show FirePHP's console output on first run
- Link to twitter in menu

Expand Down
18 changes: 17 additions & 1 deletion extension/chrome/content/firephp/FirePHP.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ const pm = PermManager.getService(nsIPermissionManager);
const DEBUG = false;
const FIREBUG_MIN_VERSION = "1.5";

var FBTrace;
if(DEBUG) {
FBTrace = Cc["@joehewitt.com/firebug-trace-service;1"].getService(Ci.nsISupports).wrappedJSObject.getTracer("extensions.firebug");
} else {
FBTrace = {
"sysout": function() {}
}
}



var FirePHP = top.FirePHP = {

Expand All @@ -84,6 +94,8 @@ var FirePHP = top.FirePHP = {
/* This variable is only used for ff2 */
enabled: false,

listenerAdded: false,

initialize: function() {

// For development
Expand Down Expand Up @@ -143,7 +155,10 @@ var FirePHP = top.FirePHP = {
/* Enable the FirePHP Service Component to set the multipart/firephp accept header */
observerService.addObserver(this, "http-on-modify-request", false);

Firebug.NetMonitor.addListener(this);
if(!this.listenerAdded) {
Firebug.NetMonitor.addListener(this);
this.listenerAdded = true;
}
},
disable: function() {

Expand All @@ -153,6 +168,7 @@ var FirePHP = top.FirePHP = {
observerService.removeObserver(this, "http-on-modify-request");

Firebug.NetMonitor.removeListener(this);
this.listenerAdded = false;
},


Expand Down

0 comments on commit 056d563

Please sign in to comment.