Closed Bug 623591 Opened 9 years ago Closed 9 years ago

Add basic support for window.console

Categories

(Firefox for Android Graveyard :: General, defect)

x86_64
Linux
defect
Not set

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: mfinkle, Assigned: mfinkle)

Details

Attachments

(1 file)

Attached patch patchSplinter Review
HUDService added simple window.console support to Mozilla. The system uses observer notifications to send the data. This patch simply hooks up the window.console to the JS Error Console in Fennec/

For platform support look in these files:
http://mxr.mozilla.org/mozilla-central/source/dom/base/ConsoleAPI.js
http://mxr.mozilla.org/mozilla-central/source/toolkit/components/console/hudservice/HUDService.jsm#3254
http://mxr.mozilla.org/mozilla-central/source/toolkit/components/console/hudservice/HUDService.jsm#1812
Attachment #501653 - Flags: review?(21)
Attachment #501653 - Flags: feedback?(mbrubeck)
Comment on attachment 501653 [details] [diff] [review]
patch

>diff --git a/chrome/content/content.js b/chrome/content/content.js
>+    if (aMessage.level == "error") {
>+      let consoleMsg = Cc["@mozilla.org/scripterror;1"].createInstance(Ci.nsIScriptError);
>+      consoleMsg.init(joinedArguments, null, null, 0, 0, Ci.nsIScriptError.errorFlag, "content javascript");
>+      Services.console.logMessage(consoleMsg)
nit: missed a ;

>+    } else if (aMessage.level == "warn") {
>+      let consoleMsg = Cc["@mozilla.org/scripterror;1"].createInstance(Ci.nsIScriptError);
>+      consoleMsg.init(joinedArguments, null, null, 0, 0, Ci.nsIScriptError.warningFlag, "content javascript");
>+      Services.console.logMessage(consoleMsg)
nit: missed a ;
Attachment #501653 - Flags: review?(21) → review+
Is this related to bug #609890?
(In reply to comment #2)
> Is this related to bug #609890?

Nope
pushed:
http://hg.mozilla.org/mobile-browser/rev/9cb17d754de0
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Attachment #501653 - Flags: feedback?(mbrubeck)
verified FIXED on build:
Mozilla/5.0 (Android; Linux armv71; rv:2.0b9pre) Gecko/20100110 Namoroka/4.0b9pre Fennec/4.0b4pre
Status: RESOLVED → VERIFIED
bugspam
Assignee: nobody → mark.finkle
You need to log in before you can comment on or make changes to this bug.