зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1323807 - Make sanitize.js handle the search bar having moved to the overflow or menu panel. r=mak
--HG-- extra : rebase_source : 9b166413b396a718d08c24737aa6715e2f369bb4
This commit is contained in:
Родитель
fc68eda3fc
Коммит
a4f102118b
|
@ -409,14 +409,20 @@ Sanitizer.prototype = {
|
|||
let refObj = {};
|
||||
TelemetryStopwatch.start("FX_SANITIZE_FORMDATA", refObj);
|
||||
try {
|
||||
// Clear undo history of all searchBars
|
||||
// Clear undo history of all search bars.
|
||||
let windows = Services.wm.getEnumerator("navigator:browser");
|
||||
while (windows.hasMoreElements()) {
|
||||
let currentWindow = windows.getNext();
|
||||
let currentDocument = currentWindow.document;
|
||||
|
||||
// searchBar.textbox may not exist due to the search bar binding
|
||||
// not having been constructed yet if the search bar is in the
|
||||
// overflow or menu panel. It won't have a value or edit history in
|
||||
// that case.
|
||||
let searchBar = currentDocument.getElementById("searchbar");
|
||||
if (searchBar)
|
||||
if (searchBar && searchBar.textbox)
|
||||
searchBar.textbox.reset();
|
||||
|
||||
let tabBrowser = currentWindow.gBrowser;
|
||||
if (!tabBrowser) {
|
||||
// No tab browser? This means that it's too early during startup (typically,
|
||||
|
|
Загрузка…
Ссылка в новой задаче