Closed Bug 798764 Opened 7 years ago Closed 7 years ago

Global console: add support for a global ConsoleProgressListener

Categories

(DevTools :: Console, defect)

defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 19

People

(Reporter: msucan, Assigned: msucan)

References

Details

(Whiteboard: [b2g])

Attachments

(1 file, 1 obsolete file)

The ConsoleProgressListener gives us location changes and file URI loads. This code should also work with the global console actor.
Assignee: nobody → mihai.sucan
Status: NEW → ASSIGNED
Attached patch proposed fix (obsolete) — Splinter Review
This patch fixes the ConsoleProgressListener such that we can use it with the global consoleActor. This patch also fixes the WebConsoleActor constructor such that it works with the b2g tab.

When you attach to the tab consoleActor on b2g you do not receive any message. Window IDs are not matching, network requests fail to give the associatedWindow and so on. For now, only the global consoleActor is useful.
Attachment #670750 - Flags: review?(past)
Depends on: 795691
Comment on attachment 670750 [details] [diff] [review]
proposed fix

Review of attachment 670750 [details] [diff] [review]:
-----------------------------------------------------------------

::: toolkit/devtools/webconsole/NetworkHelper.jsm
@@ +213,5 @@
>    getWindowForRequest: function NH_getWindowForRequest(aRequest)
>    {
> +    try {
> +      return this.getRequestLoadContext(aRequest).associatedWindow;
> +    } catch (ex) { }

This pattern seems worrisome, but I see you have been using it in this file before this patch, so OK.
Attachment #670750 - Flags: review?(past) → review+
(In reply to Mihai Sucan [:msucan] from comment #1)
> When you attach to the tab consoleActor on b2g you do not receive any
> message. Window IDs are not matching, network requests fail to give the
> associatedWindow and so on. For now, only the global consoleActor is useful.

What is the plan for getting the tab consoleActor working?
(In reply to Panos Astithas [:past] from comment #2)
> Comment on attachment 670750 [details] [diff] [review]
> proposed fix
> 
> Review of attachment 670750 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: toolkit/devtools/webconsole/NetworkHelper.jsm
> @@ +213,5 @@
> >    getWindowForRequest: function NH_getWindowForRequest(aRequest)
> >    {
> > +    try {
> > +      return this.getRequestLoadContext(aRequest).associatedWindow;
> > +    } catch (ex) { }
> 
> This pattern seems worrisome, but I see you have been using it in this file
> before this patch, so OK.

Indeed, this is really dated code, I just followed the same pattern.


(In reply to Panos Astithas [:past] from comment #3)
> (In reply to Mihai Sucan [:msucan] from comment #1)
> > When you attach to the tab consoleActor on b2g you do not receive any
> > message. Window IDs are not matching, network requests fail to give the
> > associatedWindow and so on. For now, only the global consoleActor is useful.
> 
> What is the plan for getting the tab consoleActor working?

We need to file a separate bug report about that. In B2G we want not tabs, but separation between apps and Firefox browser tabs support - if I am not mistaken. A working single-tab parent for the whole B2G won't help with anything - it would still give us all network request and errors that happen B2G - very much like the global consoleActor. It would be a lot more useful if we could select the app or the Firefox tab browser to monitor.

In either case, we *probably* need additional platform support - for example the associatedWindow property for network requests is not readable.

I wonder if we want to expose the tab consoleActor at this point on B2G? I don't know how far off we are from being able to separate errors, network requests, etc, coming from different apps.


Thanks for the review!
Blocks: 802246
Blocks: 787981
Attached patch test fixSplinter Review
Had a failure in try runs. Test fixed.

Green try run:
https://tbpl.mozilla.org/?tree=Try&rev=1da4d4ccabf6
Attachment #670750 - Attachment is obsolete: true
Landed:
https://hg.mozilla.org/integration/fx-team/rev/7d2e011a7b9f
Whiteboard: [b2g][fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/7d2e011a7b9f
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [b2g][fixed-in-fx-team] → [b2g]
Target Milestone: --- → Firefox 19
Depends on: 803991
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.