# HG changeset patch # User Atul Varma # Date 1241736173 25200 # Node ID ecd868a3224709c454450f5bb9c034f6c81f046b # Parent e82bff1ef2966e1f629a86b74822a8e69f4bdbfd better error logging, streamlined example diff -r e82bff1ef296 -r ecd868a32247 random-stuff/random-stuff.js --- a/random-stuff/random-stuff.js Thu May 07 15:26:40 2009 -0700 +++ b/random-stuff/random-stuff.js Thu May 07 15:42:53 2009 -0700 @@ -78,7 +78,14 @@ function logError(element) { var window = element.ownerDocument.defaultView; var console = window.wrappedJSObject.console; - console.error.apply(console, arguments); + if (console) + console.error.apply(console, arguments); + else { + var items = ["<" + element.nodeName.toLowerCase() + ">"]; + for (var i = 1; i < arguments.length; i++) + items.push(arguments[i].toString()); + Components.utils.reportError(items.join(" ")); + } } function absolutifyUrl(document, url) { diff -r e82bff1ef296 -r ecd868a32247 random-stuff/sample-status-bar.html --- a/random-stuff/sample-status-bar.html Thu May 07 15:26:40 2009 -0700 +++ b/random-stuff/sample-status-bar.html Thu May 07 15:42:53 2009 -0700 @@ -1,10 +1,4 @@ - - + width="100">