diff options
Diffstat (limited to 'application/palemoon/base/content/browser.js')
-rw-r--r-- | application/palemoon/base/content/browser.js | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/application/palemoon/base/content/browser.js b/application/palemoon/base/content/browser.js index 8b3fa0b4f..981ab5f0f 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'); |