[Pkg-mozext-commits] [firebug] 03/07: Issue 5712: Firefox crashes when trying to log XMLHTTPRequest to console
David Prévot
taffit at moszumanska.debian.org
Mon Mar 31 22:46:17 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to tag firebug-1.10.2
in repository firebug.
commit eb095372da7beb313f88add9653c519e688bc142
Author: Jan Odvarko <odvarko at gmail.com>
Date: Wed Aug 1 16:03:49 2012 +0200
Issue 5712: Firefox crashes when trying to log XMLHTTPRequest to console
---
extension/content/firebug/console/consolePanel.js | 32 +++++++++++++++++++++--
1 file changed, 30 insertions(+), 2 deletions(-)
diff --git a/extension/content/firebug/console/consolePanel.js b/extension/content/firebug/console/consolePanel.js
index e978cd8..5189047 100644
--- a/extension/content/firebug/console/consolePanel.js
+++ b/extension/content/firebug/console/consolePanel.js
@@ -11,14 +11,21 @@ define([
"firebug/lib/search",
"firebug/chrome/menu",
"firebug/lib/options",
+ "firebug/lib/wrapper",
+ "firebug/lib/xpcom",
"firebug/console/profiler",
"firebug/chrome/searchBox"
],
-function(Obj, Firebug, FirebugReps, Locale, Events, Css, Dom, Search, Menu, Options) {
+function(Obj, Firebug, FirebugReps, Locale, Events, Css, Dom, Search, Menu, Options,
+ Wrapper, Xpcom) {
// ********************************************************************************************* //
// Constants
+var versionChecker = Xpcom.CCSV("@mozilla.org/xpcom/version-comparator;1", "nsIVersionComparator");
+var appInfo = Xpcom.CCSV("@mozilla.org/xre/app-info;1", "nsIXULAppInfo");
+var firefox15AndHigher = versionChecker.compare(appInfo.version, "15") >= 0;
+
const Cc = Components.classes;
const Ci = Components.interfaces;
@@ -453,6 +460,27 @@ Firebug.ConsolePanel.prototype = Obj.extend(Firebug.ActivablePanel,
appendObject: function(object, row, rep)
{
+ // Issue 5712: Firefox crashes when trying to log XMLHTTPRequest to console
+ // xxxHonza: should be removed as soon as Firefox 16 is the minimum version.
+ if (!firefox15AndHigher)
+ {
+ if (typeof(object) == "object")
+ {
+ try
+ {
+ // xxxHonza: could we log directly the unwrapped object?
+ var unwrapped = Wrapper.unwrapObject(object);
+ if (unwrapped.constructor.name == "XMLHttpRequest")
+ object = object + "";
+ }
+ catch (e)
+ {
+ if (FBTrace.DBG_ERRORS)
+ FBTrace.sysout("consolePanel.appendObject; EXCEPTION " + e, e);
+ }
+ }
+ }
+
if (!rep)
rep = Firebug.getRep(object, this.context);
@@ -561,7 +589,7 @@ Firebug.ConsolePanel.prototype = Obj.extend(Firebug.ActivablePanel,
var object = objects[i];
if (typeof(object) == "string")
logTextNode(object, row);
- else
+ else
this.appendObject(object, row);
}
},
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firebug.git
More information about the Pkg-mozext-commits
mailing list