diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-09-11 20:10:59 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-09-11 20:10:59 +0200 |
commit | b07b08f9db6ac66f8b7526a0cd835bec931b0423 (patch) | |
tree | 01d0568e6c429e3686dd8ec2e33d780b4e1e03eb /application/palemoon/base/content/browser.js | |
parent | 2713347f0e0ec3014501c35cd53900732fd27176 (diff) | |
parent | 7c9b62ee0a2253858499054321b5a57b3dd19f11 (diff) | |
download | UXP-b07b08f9db6ac66f8b7526a0cd835bec931b0423.tar UXP-b07b08f9db6ac66f8b7526a0cd835bec931b0423.tar.gz UXP-b07b08f9db6ac66f8b7526a0cd835bec931b0423.tar.lz UXP-b07b08f9db6ac66f8b7526a0cd835bec931b0423.tar.xz UXP-b07b08f9db6ac66f8b7526a0cd835bec931b0423.zip |
Merge branch 'fbgw'
Diffstat (limited to 'application/palemoon/base/content/browser.js')
-rw-r--r-- | application/palemoon/base/content/browser.js | 21 |
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", |