Skip to content

Commit

Permalink
adapted selector to Firebug 2.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
mguillem committed Mar 17, 2015
1 parent 2f9acea commit 771b513
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions firefox/content/overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,13 @@ var JSErrorCollector_ErrorConsoleListener =
// We're just looking for content JS errors (see https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIScriptError#Categories)
if (errorCategory == "content javascript")
{
var console = null;
var consoleContent = null;
// try to get content from Firebug's console if it exists
try {
if (window.Firebug && window.Firebug.currentContext) {
var doc = Firebug.currentContext.getPanel("console").document;
var logNodes = doc.querySelectorAll(".logRow > span");
// console.log("doc", doc.body.innerHTML, doc)
var logNodes = doc.querySelectorAll(".logRow .logContent span");
var consoleLines = [];
for (var i=0; i<logNodes.length; ++i) {
var logNode = logNodes[i];
Expand All @@ -99,18 +100,19 @@ var JSErrorCollector_ErrorConsoleListener =
}
}

console = consoleLines.join("\n");
consoleContent = consoleLines.join("\n");
}
} catch (e) {
console = "Error extracting content of Firebug console: " + e.message;
consoleContent = "Error extracting content of Firebug console: " + e.message;
}

var err = {
errorMessage: scriptError.errorMessage,
sourceName: scriptError.sourceName,
lineNumber: scriptError.lineNumber,
console: console
console: consoleContent
};
console.log("collecting JS error", err)
JSErrorCollector.addError(err);
}
}
Expand Down

0 comments on commit 771b513

Please sign in to comment.