Permalink
Browse files

(Issue 57) Duplicate console output

  • Loading branch information...
cadorn committed Jul 19, 2010
1 parent e794b7a commit 056d5634955c3e7edfc267e784b82141aacfa817
Showing with 18 additions and 1 deletion.
  1. +1 −0 extension/CHANGELOG
  2. +17 −1 extension/chrome/content/firephp/FirePHP.js
View
@@ -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
@@ -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 = {
@@ -84,6 +94,8 @@ var FirePHP = top.FirePHP = {
/* This variable is only used for ff2 */
enabled: false,
+ listenerAdded: false,
+
initialize: function() {
// For development
@@ -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() {
@@ -153,6 +168,7 @@ var FirePHP = top.FirePHP = {
observerService.removeObserver(this, "http-on-modify-request");
Firebug.NetMonitor.removeListener(this);
+ this.listenerAdded = false;
},

0 comments on commit 056d563

Please sign in to comment.