Bug 101021

Summary: Web Inspector: add console.clear()
Product: WebKit Reporter: Andrey Lushnikov <lushnikov>
Component: Web Inspector (Deprecated)Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, apavlov, brkemper, keishi, loislo, ojan, pfeldman, pmuellr, vsevik, web-inspector-bugs, webkit.review.bot, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

Andrey Lushnikov
Reported 2012-11-01 23:58:34 PDT
downstream: http://code.google.com/p/chromium/issues/detail?id=158770 UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4 Steps to reproduce the problem: 1. Open the Developer Tools 2. Select Console 3. type console.clear() What is the expected behavior? To clear the console's log area, through the script. What went wrong? Nothing happens Did this work before? No Chrome version: 22.0.1229.94 Channel: stable OS Version: OS X 10.7.5 I know I can erase it by tying CMD+K, but I like to have a debug for my code, like, show every event triggered when I click some element. What I'd like to do is to have the whole console cleared when I click. console.clear() works on Firebug, but doesn't in Developer Tools.
Attachments
Patch (11.05 KB, patch)
2012-11-02 01:20 PDT, Andrey Lushnikov
no flags
Patch (12.73 KB, patch)
2012-11-02 08:22 PDT, Andrey Lushnikov
no flags
Patch (12.82 KB, patch)
2012-11-02 08:54 PDT, Andrey Lushnikov
no flags
Patch (14.73 KB, patch)
2012-11-06 01:30 PST, Andrey Lushnikov
no flags
Andrey Lushnikov
Comment 1 2012-11-02 01:20:10 PDT
Pavel Feldman
Comment 2 2012-11-02 01:37:45 PDT
Comment on attachment 172003 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=172003&action=review > Source/WebCore/inspector/ConsoleMessage.cpp:115 > + case ClearConsoleMessageType: return TypeBuilder::Console::ConsoleMessage::Type::Clear; Drop "Console", it's cleaner. > Source/WebCore/inspector/front-end/ConsoleMessage.js:80 > + this._messageElement = document.createTextNode("console.clear()"); I would say "Console was cleared" with gray. You'll need to put it into WebCore/English.lproj/localizedStrings.js > LayoutTests/inspector/console/console-clear-function-expected.txt:11 > +console.clear() Sounds like the source location is missing. > LayoutTests/inspector/console/console-clear-function.html:22 > + RuntimeAgent.evaluate("console.clear();", function() { Use named functions (step1)
Andrey Lushnikov
Comment 3 2012-11-02 08:22:02 PDT
Vsevolod Vlasov
Comment 4 2012-11-02 08:47:41 PDT
Comment on attachment 172064 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=172064&action=review > LayoutTests/inspector/console/console-clear-function.html:42 > +Tests that console is cleared via console.clear() method Please add a link to the bug.
Andrey Lushnikov
Comment 5 2012-11-02 08:54:00 PDT
Build Bot
Comment 6 2012-11-02 10:36:02 PDT
Andrey Lushnikov
Comment 7 2012-11-06 01:30:55 PST
WebKit Review Bot
Comment 8 2012-11-06 08:14:55 PST
Comment on attachment 172517 [details] Patch Clearing flags on attachment: 172517 Committed r133614: <http://trac.webkit.org/changeset/133614>
WebKit Review Bot
Comment 9 2012-11-06 08:15:00 PST
All reviewed patches have been landed. Closing bug.
Brad
Comment 10 2013-01-16 13:47:51 PST
Seriously? It is fixed and closed because it now prints "Console was cleared"? Shouldn't it also, you know, clear the console too? That was the OP's expected behavior, and it does not do that currently.
Pavel Feldman
Comment 11 2013-01-16 22:13:10 PST
(In reply to comment #10) > Seriously? It is fixed and closed because it now prints "Console was cleared"? Shouldn't it also, you know, clear the console too? That was the OP's expected behavior, and it does not do that currently. This option has no effect when "Preserve Log upon navigation" is toggled. You could use "clear()" in console to clean it up in such cases.
Note You need to log in before you can comment on or make changes to this bug.