Closed Bug 692829 Opened 14 years ago Closed 13 years ago

Display cached messages from iframes

Categories

(DevTools :: Console, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 25

People

(Reporter: msucan, Assigned: rcampbell)

References

Details

(Whiteboard: [webconsole])

Attachments

(1 file, 4 obsolete files)

Once bugs 611032 and 609890 land, the Web Console will only show errors and messages from the top level window of the page. We need to also display the cached messages coming from iframes.
We're doing developer tool prioritization, filter on 'brontozaur' to ignore the spam.
Priority: -- → P3
Component: Developer Tools → Developer Tools: Console
QA Contact: developer.tools → developer.tools.console
This feels higher than P3 to me. It's making test development annoying for me...
yeah, we should do better than this. Taking it for investigation.
Assignee: nobody → rcampbell
Priority: P3 → P2
Agreed. Rob, what needs to be done here is to recursively iterate through the iframes of the top level window, get their inner window IDs, and use those to match which console API messages and script errors we get from the caches. This code lives in WebConsoleUtils.jsm, see ConsoleServiceListener/PageErrorListener and ConsoleAPIListener - they both have a getCachedMessages() method. Thank you!
thanks for the run-down. I'll take a look.
rob++! that looks good!
Blocks: 883970
Attached patch v1, needs test (obsolete) — Splinter Review
tested locally, fixed failures.
Attachment #761367 - Attachment is obsolete: true
Attached patch v1.1 (obsolete) — Splinter Review
Attachment #766734 - Attachment is obsolete: true
Attachment #766792 - Flags: review?(mihai.sucan)
Attached patch v1.2 (obsolete) — Splinter Review
removed some extra testing gunk.
Attachment #766792 - Attachment is obsolete: true
Attachment #766792 - Flags: review?(mihai.sucan)
Attachment #766794 - Flags: review?(mihai.sucan)
Comment on attachment 766794 [details] [diff] [review] v1.2 Review of attachment 766794 [details] [diff] [review]: ----------------------------------------------------------------- Thanks for the patch! Patch looks good. Minor comments below. ::: browser/devtools/webconsole/test/browser_console_iframe_messages.js @@ +2,5 @@ > + * Any copyright is dedicated to the Public Domain. > + * http://creativecommons.org/publicdomain/zero/1.0/ > + */ > + > +// Check that nested iframe nsIConsoleMessages are displayed in the Web Console. Check that cached messages from nested iframes... (caching is the important part, I think) @@ +42,5 @@ > + ], > + }).then(() => { > + let text = hud.outputNode.textContent; > + ok(text.contains("iframe 1"), > + "nsIConsoleMessages are not displayed for iframes"); not displayed? Also, why not put "iframe 1", "iframe 2" and "iframe 3" up in the messages array for the waitForMessages() call? Also, you can add count: 2, for "iframe 1" to make sure that message shows twice. @@ +83,5 @@ > + "nsIConsoleMessages are not displayed for iframes in browser console"); > + ok(text.contains("iframe 2"), > + "nsIConsoleMessages are not displayed for iframes (confirmed) in browser console"); > + is(text.match(/iframe 1/g).length, 2, > + "nested iframe console messages not displayed in browser console"); Same as above. ::: toolkit/devtools/webconsole/WebConsoleUtils.jsm @@ +148,3 @@ > }, > > + getInnerWindowIDsForFrames: function WCU_getInnerWindowIDsForFrames(aWindow) Maybe we should add a js comment for this new function. @@ +149,5 @@ > > + getInnerWindowIDsForFrames: function WCU_getInnerWindowIDsForFrames(aWindow) > + { > + if (!aWindow) > + return []; Do we need this? It seems to me that callers should not invoke this method if there's no |window|. @@ +1158,4 @@ > */ > getCachedMessages: function CAL_getCachedMessages(aIncludePrivate = false) > { > + let ids = WebConsoleUtils.getInnerWindowIDsForFrames(this.window); Maybe we should do this only if this.window is available.
Attachment #766794 - Flags: review?(mihai.sucan) → review+
alright.
ps, thanks for the review. :)
Status: NEW → ASSIGNED
Attached patch v1.3Splinter Review
comments addressed.
Attachment #766794 - Attachment is obsolete: true
Attachment #767195 - Flags: review+
Flags: in-testsuite+
Whiteboard: [webconsole] → [webconsole][fixed-in-fx-team]
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Whiteboard: [webconsole][fixed-in-fx-team] → [webconsole]
Target Milestone: --- → Firefox 25
Depends on: 888407
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: