RESOLVED FIXED 134414
Web Inspector: Add a setting for clearing the console on page reload
https://bugs.webkit.org/show_bug.cgi?id=134414
Summary Web Inspector: Add a setting for clearing the console on page reload
Ronald Jett
Reported 2014-06-27 15:04:38 PDT
The Web Inspector should have a setting that will clear the console on reload.
Attachments
patch (5.91 KB, patch)
2014-07-10 12:39 PDT, Ronald Jett
no flags
patch (4.08 KB, patch)
2015-02-19 13:44 PST, Ronald Jett
no flags
patch (4.01 KB, patch)
2015-02-20 10:22 PST, Ronald Jett
no flags
Radar WebKit Bug Importer
Comment 1 2014-06-27 15:04:57 PDT
Ronald Jett
Comment 2 2014-07-10 12:39:54 PDT
Timothy Hatcher
Comment 3 2014-07-10 13:16:58 PDT
Comment on attachment 234719 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=234719&action=review > Source/WebInspectorUI/UserInterface/Views/LogContentView.js:113 > get navigationItems() > { > - return [this._searchBar, this._scopeBar, this._clearLogNavigationItem, this._toggleSplitNavigationItem]; > + return [this._searchBar, this._scopeBar, this._clearLogNavigationItem, this._clearLogOnReloadNavigationItem, this._toggleSplitNavigationItem]; I don't think a navigation bar item is the right UI for this at this time. (We would need a new icon that is not confusing with a general Reload.) Lets add it to the context menu. You can do that in _handleContextMenuEvent by using appendCheckboxItem. You should also do appendSeparator between the existing Clear Log item. > Source/WebInspectorUI/UserInterface/Views/LogContentView.js:301 > + if (this._clearLogOnReloadSetting.value) { > + this._clearLog(); > + } WebKit style is to not use braces for single lines.
Ronald Jett
Comment 4 2015-02-19 13:44:32 PST
Ronald Jett
Comment 5 2015-02-19 13:47:12 PST
I updated the code, taking in to account your feedback. Sorry it took so long. Let me know what you think.
Timothy Hatcher
Comment 6 2015-02-19 16:07:50 PST
Comment on attachment 246915 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=246915&action=review > Source/WebInspectorUI/UserInterface/Views/LogContentView.js:75 > + this._clearLogOnReloadSetting = new WebInspector.Setting("clear-log-on-reload", false); We might want to default it to true. > Source/WebInspectorUI/UserInterface/Views/LogContentView.js:343 > + var clearLogOnReloadUIString = WebInspector.UIString("Clear Log on Reload"); > + > + if (this._clearLogOnReloadSetting.value) > + clearLogOnReloadUIString = WebInspector.UIString("Keep Log on Reload"); Nit: Could be one line: this._clearLogOnReloadSetting.value ? WebInspector.UIString("Keep Log on Reload") : WebInspector.UIString("Clear Log on Reload");
Ronald Jett
Comment 7 2015-02-20 10:22:44 PST
Ronald Jett
Comment 8 2015-02-20 10:23:49 PST
Updated the if to be a ternary. Switching the setting to be true by default. Is there a WebKit JS style guide somewhere?
Joseph Pecoraro
Comment 9 2015-02-20 10:52:43 PST
> Is there a WebKit JS style guide somewhere? This gets occasional updates: http://trac.webkit.org/wiki/WebInspectorCodingStyleGuide
WebKit Commit Bot
Comment 10 2015-02-20 11:35:41 PST
Comment on attachment 246975 [details] patch Clearing flags on attachment: 246975 Committed r180432: <http://trac.webkit.org/changeset/180432>
WebKit Commit Bot
Comment 11 2015-02-20 11:35:47 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.