summaryrefslogtreecommitdiffstats
path: root/application/palemoon/base/content/browser.js
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-09-09 08:26:13 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-09-09 08:26:13 +0200
commit1c455d9cb002b15e28c7e12883a57f020433ce5d (patch)
tree194c93450b86b278c38c6293b1680428619e90fd /application/palemoon/base/content/browser.js
parentaa9cd0d77dcdfc9daddc4f8b78d4578d2507018d (diff)
downloadUXP-1c455d9cb002b15e28c7e12883a57f020433ce5d.tar
UXP-1c455d9cb002b15e28c7e12883a57f020433ce5d.tar.gz
UXP-1c455d9cb002b15e28c7e12883a57f020433ce5d.tar.lz
UXP-1c455d9cb002b15e28c7e12883a57f020433ce5d.tar.xz
UXP-1c455d9cb002b15e28c7e12883a57f020433ce5d.zip
Revert "Minimal easy fix -- move findbar getters to tabbrowser."
This reverts commit fb291846a59f9b8eaf8bba29e0d9794893e895bf.
Diffstat (limited to 'application/palemoon/base/content/browser.js')
-rw-r--r--application/palemoon/base/content/browser.js21
1 files changed, 14 insertions, 7 deletions
diff --git a/application/palemoon/base/content/browser.js b/application/palemoon/base/content/browser.js
index c7a2633d4..5cf43850a 100644
--- a/application/palemoon/base/content/browser.js
+++ b/application/palemoon/base/content/browser.js
@@ -53,13 +53,20 @@ var gEditUIVisible = true;
// Smart getter for the findbar. If you don't wish to force the creation of
// the findbar, check gFindBarInitialized first.
-
-this.__defineGetter__("gFindBar", function() {
- return window.gBrowser.getFindBar();
-});
-
-this.__defineGetter__("gFindBarInitialized", function() {
- return window.gBrowser.isFindBarInitialized();
+var gFindBarInitialized = false;
+XPCOMUtils.defineLazyGetter(window, "gFindBar", function() {
+ let XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
+ let findbar = document.createElementNS(XULNS, "findbar");
+ findbar.id = "FindToolbar";
+
+ let browserBottomBox = document.getElementById("browser-bottombox");
+ browserBottomBox.insertBefore(findbar, browserBottomBox.firstChild);
+
+ // Force a style flush to ensure that our binding is attached.
+ findbar.clientTop;
+ findbar.browser = gBrowser.mCurrentBrowser;
+ window.gFindBarInitialized = true;
+ return findbar;
});
XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",