Sanitizer.clearItem("history") not cleaning history

RESOLVED FIXED in Firefox 16

Status

()

RESOLVED FIXED
6 years ago
2 years ago

People

(Reporter: public, Assigned: mbrubeck)

Tracking

14 Branch
Firefox 16
ARM
Android
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
STR:
With a window as "window", execute:
let san = new window.Sanitizer();
san.clearItem("history");

Tested from within a menu button's handler code (window.NativeWindow.menu.add).

Expected:
History should be cleared.

Actual:
History is not cleared.

As the button-stuff in the preference menu works, I assume it is somewhere between gecko and the native ui causing the issue. The Sanitizers clean history method looks too short for me, as at least in desktop firefox the cleaning is done within the sanitizer, and not only a event broadcasted.
Sanitizer Code (mobile/android/chrome/content/sanitize.js):
try {
  Services.obs.notifyObservers(null, "browser:purge-session-history", "");
} catch (e) { }
// Clear last URL of the Open Web Location dialog
try {
  Services.prefs.clearUserPref("general.open_location.last_url");
} catch (e) { }
(Assignee)

Comment 1

6 years ago
History is currently cleared by calling BrowserDB.clearHistory and GeckoApp.handleClearHistory in the Android Java code.  There's no way to clear it from JavaScript code (e.g. for an add-on).  We should fix this.
Assignee: nobody → mbrubeck
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Comment 2

6 years ago
Created attachment 639498 [details] [diff] [review]
patch
Attachment #639498 - Flags: review?(mark.finkle)
Attachment #639498 - Flags: review?(mark.finkle) → review+
https://hg.mozilla.org/mozilla-central/rev/d5d75d1a87f5
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 16
(Reporter)

Comment 5

6 years ago
Thank you very much for that fast fix :)
You need to log in before you can comment on or make changes to this bug.