summaryrefslogtreecommitdiffstats
path: root/application/palemoon/base/content/browser.js
diff options
context:
space:
mode:
authorNew Tobin Paradigm <email@mattatobin.com>2018-04-13 11:15:36 -0400
committerGitHub <noreply@github.com>2018-04-13 11:15:36 -0400
commitaedeefe89855b36da07a021a772cd02c37d6b887 (patch)
tree0b8376f33206c8c0c6232d122597e3a4c591cb98 /application/palemoon/base/content/browser.js
parent12c1588b940ca8bbaff5632a847189ebb9a430f0 (diff)
parentda92d3703332ad41e8a2bf3aa66cb867c336e0b0 (diff)
downloadUXP-aedeefe89855b36da07a021a772cd02c37d6b887.tar
UXP-aedeefe89855b36da07a021a772cd02c37d6b887.tar.gz
UXP-aedeefe89855b36da07a021a772cd02c37d6b887.tar.lz
UXP-aedeefe89855b36da07a021a772cd02c37d6b887.tar.xz
UXP-aedeefe89855b36da07a021a772cd02c37d6b887.zip
Merge pull request #141 from janekptacijarabaci/pm_findbar_1
Fix: Findbar broken
Diffstat (limited to 'application/palemoon/base/content/browser.js')
-rw-r--r--application/palemoon/base/content/browser.js32
1 files changed, 10 insertions, 22 deletions
diff --git a/application/palemoon/base/content/browser.js b/application/palemoon/base/content/browser.js
index 8b3fa0b4f..cdf139bbb 100644
--- a/application/palemoon/base/content/browser.js
+++ b/application/palemoon/base/content/browser.js
@@ -65,6 +65,9 @@ XPCOMUtils.defineLazyGetter(window, "gFindBar", function() {
return findbar;
});
+XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
+ "resource://gre/modules/BrowserUtils.jsm");
+
XPCOMUtils.defineLazyGetter(this, "gPrefService", function() {
return Services.prefs;
});
@@ -3426,26 +3429,6 @@ function updateCharacterEncodingMenuState()
}
}
-/**
- * Returns true if |aMimeType| is text-based, false otherwise.
- *
- * @param aMimeType
- * The MIME type to check.
- *
- * If adding types to this function, please also check the similar
- * function in findbar.xml
- */
-function mimeTypeIsTextBased(aMimeType)
-{
- return aMimeType.startsWith("text/") ||
- aMimeType.endsWith("+xml") ||
- aMimeType == "application/x-javascript" ||
- aMimeType == "application/javascript" ||
- aMimeType == "application/json" ||
- aMimeType == "application/xml" ||
- aMimeType == "mozilla.application/cached-xul";
-}
-
var XULBrowserWindow = {
// Stored Status, Link and Loading values
status: "",
@@ -3669,7 +3652,7 @@ var XULBrowserWindow = {
this.setDefaultStatus(msg);
// Disable menu entries for images, enable otherwise
- if (!gMultiProcessBrowser && content.document && mimeTypeIsTextBased(content.document.contentType))
+ if (!gMultiProcessBrowser && content.document && BrowserUtils.mimeTypeIsTextBased(content.document.contentType))
this.isImage.removeAttribute('disabled');
else
this.isImage.setAttribute('disabled', 'true');
@@ -3717,7 +3700,7 @@ var XULBrowserWindow = {
}
// Disable menu entries for images, enable otherwise
- if (!gMultiProcessBrowser && content.document && mimeTypeIsTextBased(content.document.contentType))
+ if (!gMultiProcessBrowser && content.document && BrowserUtils.mimeTypeIsTextBased(content.document.contentType))
this.isImage.removeAttribute('disabled');
else
this.isImage.setAttribute('disabled', 'true');
@@ -3815,11 +3798,16 @@ var XULBrowserWindow = {
gFindBar.close();
}
+ // XXX
+ // See: https://github.com/MoonchildProductions/Pale-Moon/issues/364
+ // An actual preference: findbar.highlightAll
+ /*
if (!(gPrefService.getBoolPref("accessibility.typeaheadfind.highlightallremember") ||
gPrefService.getBoolPref("accessibility.typeaheadfind.highlightallbydefault"))) {
// fix bug 253793 - turn off highlight when page changes
gFindBar.getElement("highlight").checked = false;
}
+ */
}
}
UpdateBackForwardCommands(gBrowser.webNavigation);