summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoonchild <mcwerewolf@wolfbeast.com>2018-11-29 00:47:48 +0100
committerGitHub <noreply@github.com>2018-11-29 00:47:48 +0100
commitb585dad9be7356ab896676adf7ca6638ccff1824 (patch)
tree67449d868b515aa66e8e1fa24adf31f21f1ebe57
parentfe11e14d3cfc2900facf152257acda87280b6cdc (diff)
parent3e89a288d7da22744f4f8575c4547977580466fe (diff)
downloadUXP-b585dad9be7356ab896676adf7ca6638ccff1824.tar
UXP-b585dad9be7356ab896676adf7ca6638ccff1824.tar.gz
UXP-b585dad9be7356ab896676adf7ca6638ccff1824.tar.lz
UXP-b585dad9be7356ab896676adf7ca6638ccff1824.tar.xz
UXP-b585dad9be7356ab896676adf7ca6638ccff1824.zip
Merge pull request #886 from JustOff/PR_sanitize_findbar
[PALEMOON] Make Clear Recent History work with restored global Findbar
-rw-r--r--application/palemoon/base/content/sanitize.js24
1 files changed, 7 insertions, 17 deletions
diff --git a/application/palemoon/base/content/sanitize.js b/application/palemoon/base/content/sanitize.js
index 0c85fa215..b4d13d895 100644
--- a/application/palemoon/base/content/sanitize.js
+++ b/application/palemoon/base/content/sanitize.js
@@ -257,18 +257,13 @@ Sanitizer.prototype = {
.getService(Components.interfaces.nsIWindowMediator);
var windows = windowManager.getEnumerator("navigator:browser");
while (windows.hasMoreElements()) {
- let currentWindow = windows.getNext();
- let currentDocument = currentWindow.document;
+ let currentDocument = windows.getNext().document;
let searchBar = currentDocument.getElementById("searchbar");
if (searchBar)
searchBar.textbox.reset();
- let tabBrowser = currentWindow.gBrowser;
- for (let tab of tabBrowser.tabs) {
- if (tabBrowser.isFindBarInitialized(tab))
- tabBrowser.getFindBar(tab).clear();
- }
- // Clear any saved find value
- tabBrowser._lastFindValue = "";
+ let findBar = currentDocument.getElementById("FindToolbar");
+ if (findBar)
+ findBar.clear();
}
let change = { op: "remove" };
@@ -284,8 +279,7 @@ Sanitizer.prototype = {
.getService(Components.interfaces.nsIWindowMediator);
var windows = windowManager.getEnumerator("navigator:browser");
while (windows.hasMoreElements()) {
- let currentWindow = windows.getNext();
- let currentDocument = currentWindow.document;
+ let currentDocument = windows.getNext().document;
let searchBar = currentDocument.getElementById("searchbar");
if (searchBar) {
let transactionMgr = searchBar.textbox.editor.transactionManager;
@@ -296,12 +290,8 @@ Sanitizer.prototype = {
return false;
}
}
- let tabBrowser = currentWindow.gBrowser;
- let findBarCanClear = Array.some(tabBrowser.tabs, function (aTab) {
- return tabBrowser.isFindBarInitialized(aTab) &&
- tabBrowser.getFindBar(aTab).canClear;
- });
- if (findBarCanClear) {
+ let findBar = currentDocument.getElementById("FindToolbar");
+ if (findBar && findBar.canClear) {
aCallback("formdata", true, aArg);
return false;
}