Closed Bug 1134845 Opened 11 years ago Closed 10 years ago

Add clearHistory jsterm helper to remove persisted console input history

Categories

(DevTools :: Console, defect)

x86
macOS
defect
Not set
normal

Tracking

(firefox39 fixed)

RESOLVED FIXED
Firefox 39
Tracking Status
firefox39 --- fixed

People

(Reporter: bgrins, Assigned: bgrins)

References

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

This is a follow up to Bug 943306 to allow a way to clear the saved console history. The proposal is to add a jsterm helper for "clearHistory()" that will send a helperResult of clearHistory to indicate to the frontend to do so.
We have this old bug to alias our clear() helper to console.clear - I wonder if it would make sense to also add this method to the console object as they are related? We could see if the chrome folks were interested in adding it as well. See bug 659625
See Also: → 659625
(In reply to Jeff Griffiths (:canuckistani) from comment #1) > We have this old bug to alias our clear() helper to console.clear - I wonder > if it would make sense to also add this method to the console object as they > are related? We could see if the chrome folks were interested in adding it > as well. The only problem with that is that a web page could call console.clearHistory and wipe out your saved data. (and/or clear your output). To me, this makes sense as a js term helper (only available when inputting directly into the console).
(In reply to Brian Grinstead [:bgrins] from comment #2) > (In reply to Jeff Griffiths (:canuckistani) from comment #1) > > We have this old bug to alias our clear() helper to console.clear - I wonder > > if it would make sense to also add this method to the console object as they > > are related? We could see if the chrome folks were interested in adding it > > as well. > > The only problem with that is that a web page could call > console.clearHistory and wipe out your saved data. (and/or clear your > output). To me, this makes sense as a js term helper (only available when > inputting directly into the console). Yeah, forget I said anything.
Adds a jsterm helper for clearHistory() that will remove all entries from the active toolbox any future ones. Try push: https://treeherder.mozilla.org/#/jobs?repo=try&revision=443cf848d591
Assignee: nobody → bgrinstead
Status: NEW → ASSIGNED
Attachment #8567361 - Flags: review?(past)
Comment on attachment 8567361 [details] [diff] [review] console-clearHistory.patch Review of attachment 8567361 [details] [diff] [review]: ----------------------------------------------------------------- Great, don't forget to update MDN once this lands: https://developer.mozilla.org/docs/Tools/Web_Console/Helpers
Attachment #8567361 - Flags: review?(past) → review+
Flags: in-testsuite+
Keywords: checkin-needed
Whiteboard: [fixed-in-fx-team]
Will, could you please add a note for this new 'clearHistory()' jsterm helper? It will clear out any webconsole commands that have been saved to your profile (a feature added for 39 in Bug 943306).
Flags: needinfo?(wbamberg)
Keywords: dev-doc-needed
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 39
I'll update MDN when this is in Developer Edition, unless you need it sooner.
Flags: needinfo?(wbamberg)
(In reply to Will Bamberg [:wbamberg] from comment #10) > I'll update MDN when this is in Developer Edition, unless you need it sooner. That'd be perfect, thanks!
(In reply to Will Bamberg [:wbamberg] from comment #12) > bgrins, I've added notes here: > https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Command_history > and here: > https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Helper_commands. > Does that cover it? Looks good, thanks.
Flags: needinfo?(bgrinstead)
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: