Open Bug 838888 Opened 7 years ago Updated 7 years ago

Web Console sidebar

Categories

(SeaMonkey :: Sidebar, enhancement)

enhancement
Not set

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: neil, Assigned: neil)

Details

Attachments

(2 files)

I thought I'd write a very basic web console sidebar just to see what people thought of it.
Attached patch WIPSplinter Review
Well, it's a start.

Once open, the Web Console sidebar will log JavaScript errors and warnings coming from the current tab, and also calls to console.debug/info/log/warn/error.

Console calls allow multiple parameters which show as separate lines. All messages have tooltips in case they don't fit.
Assignee: nobody → neil
Status: NEW → ASSIGNED
Attachment #711048 - Flags: feedback?(philip.chee)
Attachment #711048 - Flags: feedback?(mnyromyr)
Attachment #711048 - Flags: feedback?(iann_bugzilla)
Attachment #711048 - Flags: feedback?(bugzilla)
Comment on attachment 711048 [details] [diff] [review]
WIP

When I try to open web console sidebar I get:
File Not Found

The file /home/ian/central/sm-opt/mozilla/dist/bin/chrome/comm/content/communicator/sidebar/console.xul cannot be found. Please check the location and try again.
Could the item have been renamed, removed, or relocated?Is there a spelling, capitalization, or other typographical error in the address?Do you have sufficient access permissions to the requested item?
Try Again

Missing some jar entries?
Attachment #711048 - Flags: feedback?(iann_bugzilla) → feedback-
Attached patch WIPSplinter Review
With jar.mn changes.

(Sorry, I'm too lazy to transfer the other feedback requests.)
Attachment #717670 - Flags: review?(iann_bugzilla)
(In reply to Ian Neal from comment #2)
> The file
> /home/ian/central/sm-opt/mozilla/dist/bin/chrome/comm/content/communicator/
> sidebar/console.xul cannot be found.

D'oh. And I tried to pin down what I did break now in my tree …
Comment on attachment 717670 [details] [diff] [review]
WIP

At the moment only warnings are being displayed in the web console sidebar and do not have any context, just the error itself (e.g. Unknown property 'user-select'.  Declaration dropped.) There are no entries for timestamp, source file (including line and column) or source code.
There is also no way of filtering, clearing or copying (but you can select) messages.
f+ for the work so far.
Attachment #717670 - Flags: review?(iann_bugzilla) → feedback+
Attachment #711048 - Flags: feedback?(mnyromyr) → feedback?
Comment on attachment 717670 [details] [diff] [review]
WIP

I seem to see what Ian sees. ;-)
Insofar it's a start …
Attachment #717670 - Flags: feedback+
Comment on attachment 717670 [details] [diff] [review]
WIP

Just wondering: Is it possible to change the color/contrast when selecting an entry? When selecting an entry in the web console, the contrast between the "Warning" text and the surrounding gray area is a bit weak. As the text color gets changed to white and the surrounding gray area gets even a bit brighter when selected.
Also a context menu would be nice to be able to copy a console message to clipboard.
Comment on attachment 711048 [details] [diff] [review]
WIP

And I agree with Ian on the context missing thing :)
Attachment #711048 - Flags: feedback?(bugzilla)
Comment on attachment 717670 [details] [diff] [review]
WIP

> +  var win = utils.getOuterWindowWithId(aEvent.ID);
Services.wm.getOuterWindowWithId((aEvent.ID);

http://hg.mozilla.org/mozilla-central/annotate/4ac6c72b06c8/dom/interfaces/base/nsIDOMWindowUtils.idl#l1114

@deprecated Use nsIWindowMediator.getOuterWindowWithId.  See bug 865664

> +  var item = document.createElement("richlistitem");
Consider using derived richlistitem/richlistbox bindings like the Toolkit Error Console (possibly in a followup bug).

> +  item.orient = "vertical";
What happens if you don't set the orientation?

> +  var box = document.createElement("groupbox");
Looks ugly. Lots of whitespace around each groupbox.

> +  var level = document.createElement("caption");
Instead of text perhaps you could reuse the icons in the Toolkit Error Console? e.g.
http://mxr.mozilla.org/comm-central/source/suite/themes/modern/global/console/console.css#76
and this:
http://mxr.mozilla.org/comm-central/source/mozilla/toolkit/themes/windows/global/console/console.css#88
And put the icons on the left side of the row rather than as a caption pokeing up.

> +  var limit = console.childNodes.item(250);
Ooo Er magic number! How about a const LIMIT = 250; ?

Based on my experience with Console2, I think it's safe to increase this to 500.

console.warn("foobar"); and console.error("foobar"); generates two console messages (groupboxes) each. Why is that? log, debug, and info produce one groupbox each.
Attachment #717670 - Flags: feedback-
>> +  var level = document.createElement("caption");
> Instead of text perhaps you could reuse the icons in the Toolkit Error Console? e.g.
Not to mention not localizable.
Attachment #711048 - Flags: feedback?(philip.chee)
You need to log in before you can comment on or make changes to this bug.