According to , Firefox's console.log has had string substitutions since Firefox 9.0. If I open the web console and run console.log("foo %s", "bar) I get "foo bar", as expected. But the same use of string substitutions in addon code fails, and no substitution is performed. I've created a simple example add-on  to demonstrate this problem. STR: 1. Install the example add-on (in a clean profile if you want) 2. Check the Browser Console (or your terminal, if you ran Firefox from the command line) 3. Output: "foo %s, 1+1=%d, Math.PI=%f" "bar" 2 3.141592653589793 4. Expected: "foo bar, 1+1=2, Math.PI=3.141592653589793" This addon was created with the Jetpack SDK , so it's possible that the issue is with those API's instead.  https://developer.mozilla.org/en-US/docs/Web/API/console#Using_string_substitutions  https://people.mozilla.org/~grobinson/console-string-sub-bug.xpi  https://developer.mozilla.org/en-US/Add-ons/SDK
+1, I think we should pursue a 'no surprises' policy with console, it should work consistently regardless of environment.
The console API is being rewritten in C++ and it will unify implementations.
Depends on: 965860
Whiteboard: [console-papercuts] → [console-papercuts][devedition-40]
Andrea - now that bug 988636 is resolved, what needs to happen here? Mainly curious, this isn't very high priority just now.
Whiteboard: [console-papercuts][devedition-40] → [console-papercuts]
We didn't fix that bug yet. We unified the console in workers and main-thread but not for JSM/addons. The main reason is because that is used completely in a different way: 1. You have to import Console.jsm 2. Then create your own Console object with custom optional parameters So, all of this is still implemented separately by Console.jsm. Very low priority, my plan is to replace the implementation with the C++ Console, without changing the current behavior too much. Unfortunately we cannot get rid of Console.jsm because it's used by way too many addons.
Thanks - I agree this is lower priority. I suppose we could hollow out Console.jsm so it's just a shim on the C++ component as much as possible?
Yes, that's the plan.
This is just a WIP. It breaks all the jetpack console tests and all the devtools tests (ignore the crash, that is already fixed): https://treeherder.mozilla.org/#/jobs?repo=try&revision=6e64c3432690 I wonder how much we can change the tests to make it pass...
Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.