Last Comment Bug 852220 - nsIConsoleService does not work properly
: nsIConsoleService does not work properly
: addon-compat, regression
Product: Core
Classification: Components
Component: General (show other bugs)
: 21 Branch
: x86_64 Windows 7
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
Depends on:
Blocks: 831428
  Show dependency treegraph
Reported: 2013-03-18 11:06 PDT by Alice0775 White
Modified: 2013-03-18 22:56 PDT (History)
3 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description Alice0775 White 2013-03-18 11:06:17 PDT
Build Identifier:
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20130318 Firefox/22.0 ID:20130318030947

Executing the following code in ScratchPad(chrome privilege) should appear an alert box.
However since Aurora20.0a2, alert box does not pop up anymore.

function myLogToConsole(aMessage, aSourceName, aSourceLine, aLineNumber,
                        aColumnNumber, aFlags, aCategory) {
  var consoleService = Components.classes[";1"]
  var scriptError = Components.classes[";1"]
  scriptError.init(aMessage, aSourceName, aSourceLine, aLineNumber,
                   aColumnNumber, aFlags, aCategory);

var errorListener = {
  QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIConsoleListener,
  observe: function(message) {
    if ("QueryInterface" in message) {
      var error = message.QueryInterface(Components.interfaces.nsIScriptError);

var consoleService = Components.classes[";1"]

myLogToConsole("my message", "", "", "",  "", 1, "myerror");


If I changed last line
>> consoleService.unregisterListener(errorListener);
>> setTimeout(function(){ consoleService.unregisterListener(errorListener);}, 0);

then it works as expected.
Comment 1 Alice0775 White 2013-03-18 11:07:54 PDT
s/However since Aurora20.0a2/However since Aurora21.0a2/
Comment 2 Boris Zbarsky [:bz] (still a bit busy) 2013-03-18 11:40:13 PDT
This was a purposeful change with bug 831428.  See in particular bug 831428 comment 9.

I believe this bug as filed is wontfix.
Comment 3 Alice0775 White 2013-03-18 12:00:55 PDT
Stylish 1.3.1( ) is affected.
See forum
Comment 4 Boris Zbarsky [:bz] (still a bit busy) 2013-03-18 12:31:25 PDT
Hmm.  We didn't have any addon messaging about this, did we?  We probably should.
Comment 5 Jorge Villalobos [:jorgev] 2013-03-18 14:05:06 PDT
(In reply to Boris Zbarsky (:bz) from comment #4)
> Hmm.  We didn't have any addon messaging about this, did we?  We probably
> should.

Not yet, no. I flagged bug 831428 for addon-compat and we will definitely include it in our messaging.
Comment 6 Benjamin Smedberg [:bsmedberg] 2013-03-18 22:56:09 PDT
Yes, this was an intentional change. I didn't expect that anything other than unit tests could possibly depend on the current behavior, but apparently they do!

Note You need to log in before you can comment on or make changes to this bug.