Closed
Bug 762240
Opened 13 years ago
Closed 13 years ago
Make console.{log, etc.} work from content processes
Categories
(Firefox OS Graveyard :: General, defect)
Firefox OS Graveyard
General
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: cjones, Assigned: cjones)
References
Details
Attachments
(3 files)
852 bytes,
patch
|
Details | Diff | Splinter Review | |
7.03 KB,
patch
|
vingtetun
:
review+
|
Details | Diff | Splinter Review |
7.04 KB,
patch
|
Details | Diff | Splinter Review |
I thought we had remoted this as part of the xul-fennec work, but console.log() doesn't work in current b2g.
Assignee | ||
Comment 1•13 years ago
|
||
Comment 2•13 years ago
|
||
We only remoted the console service, not the web console object.
Assignee | ||
Comment 3•13 years ago
|
||
I was under the impression that the web console used the console service, but I'm not 100% sure how this works in b2g.
Assignee | ||
Comment 4•13 years ago
|
||
So shell.js implements console.* in b2g. It's not loaded as a frame script.
I moved the console.* impl from shell.js into webapi.js, which is supposed to be loaded as a frame script, but it doesn't work either.
If the problem is that the webapi.js frame script isn't being in out-of-process frames, then that would explain this bug and bug 761924.
Comment 5•13 years ago
|
||
> If the problem is that the webapi.js frame script isn't being in out-of-process frames
Ah, maybe we need something akin to http://hg.mozilla.org/mozilla-central/file/c779db92fef2/dom/base/BrowserElementParent.js#l119
Assignee | ||
Comment 6•13 years ago
|
||
shell.js already tries to load webapi.js as a frame script.
I think the problem is that the out-of-process iframes are loaded by the *system app*, which is a different nsIFrameLoader. So we probably need webapi.js to propagate itself.
That won't fix this bug since we must only have one webconsole listener per process, but it could fix bug 761924.
Assignee | ||
Comment 7•13 years ago
|
||
Thanks jlebar!
Yes, it turns out that the way we're loading webapi.js is totally wrong. I'll see how much I can fix before my hack time runs out.
Assignee | ||
Comment 8•13 years ago
|
||
Assignee: nobody → jones.chris.g
Attachment #630853 -
Flags: review?(fabrice)
Comment 10•13 years ago
|
||
Hmm, how bug 761924 is a duplicate of that one?
Assignee | ||
Comment 11•13 years ago
|
||
They're manifestations of the same underlying problem so I fixed them together.
Comment 12•13 years ago
|
||
Comment on attachment 630853 [details] [diff] [review]
Install a console.* shim for all browser frames, and ensure we load webapi.js properly
Review of attachment 630853 [details] [diff] [review]:
-----------------------------------------------------------------
::: b2g/chrome/content/shell.js
@@ -349,5 @@
> - " at " + message.filename + ":" + message.lineNumber +
> - " in " + (message.functionName || "anonymous") + ": ";
> - Services.console.logStringMessage(prefix + Array.join(message.arguments, " "));
> -}, "console-api-log-event", false);
> -
Now that bug 673148 has landed we should think about building a remote web console (i have a broken proto on my disk that I need to revived) but I guess this code is fine for now.
nit: the rest of the file use ' instead of "
::: b2g/components/ProcessGlobal.js
@@ +62,5 @@
> + let mm = frameLoader.messageManager;
> + try {
> + mm.loadFrameScript(kWebApiShimFile, true);
> + } catch (e) {
> + log("Error loading "+ kWebApiShimFile +" as frame script: "+ e +"\n");
nit: it miss some spaces before and after some +
Attachment #630853 -
Flags: review?(fabrice) → review+
Assignee | ||
Comment 13•13 years ago
|
||
(In reply to Vivien Nicolas (:vingtetun) from comment #12)
> Comment on attachment 630853 [details] [diff] [review]
> Install a console.* shim for all browser frames, and ensure we load
> webapi.js properly
>
> > + log("Error loading "+ kWebApiShimFile +" as frame script: "+ e +"\n");
>
> nit: it miss some spaces before and after some +
Ugh really? :) That whitespace just obfuscates the interesting things. The ' ' characters inside the strings serve to delimit the interesting lexemes. But W.
Assignee | ||
Comment 14•13 years ago
|
||
Assignee | ||
Comment 15•13 years ago
|
||
Comment 16•13 years ago
|
||
Was console.log broken with in-process <iframe mozbrowser>? This patch injects code for both in-process and OOP...
Assignee | ||
Comment 17•13 years ago
|
||
No. But the injected code doesn't hook console.log.
Comment 18•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/332ed5402ccf
(Merged by Ed Morley)
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•