зеркало из https://github.com/mozilla/pjs.git
Bug 324354: Ctrl-Z (undo) reveals visited URLs AFTER clearing history, patch by Martijn Wargers <martijn.martijn@gmail.com>, r=mconnor
This commit is contained in:
Родитель
371cc37842
Коммит
929b32b1a3
|
@ -151,6 +151,19 @@ Sanitizer.prototype = {
|
|||
formdata: {
|
||||
clear: function ()
|
||||
{
|
||||
//Clear undo history of all searchBars
|
||||
var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService();
|
||||
var windowManagerInterface = windowManager.QueryInterface(Components.interfaces.nsIWindowMediator);
|
||||
var windows = windowManagerInterface.getEnumerator("navigator:browser");
|
||||
while (windows.hasMoreElements()) {
|
||||
var searchBar = windows.getNext().document.getElementById("searchbar");
|
||||
if (searchBar) {
|
||||
searchBar.mTextbox.value = "";
|
||||
searchBar.mTextbox.editor.enableUndo(false);
|
||||
searchBar.mTextbox.editor.enableUndo(true);
|
||||
}
|
||||
}
|
||||
|
||||
var formHistory = Components.classes["@mozilla.org/satchel/form-history;1"]
|
||||
.getService(Components.interfaces.nsIFormHistory);
|
||||
formHistory.removeAllEntries();
|
||||
|
|
Загрузка…
Ссылка в новой задаче