зеркало из https://github.com/mozilla/pjs.git
remove preference imageblocker.enabled.
b=208882, patch by mconnor@myrealbox.com, r=mvl, sr=alecf.
This commit is contained in:
Родитель
9cd9cc5049
Коммит
7eaa3a52b5
|
@ -1,194 +0,0 @@
|
|||
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
// SYNTAX HINTS: dashes are delimiters. Use underscores instead.
|
||||
// The first character after a period must be alphabetic.
|
||||
|
||||
// pref("startup.homepage_override_url","chrome://browser-region/locale/region.properties");
|
||||
pref("general.startup.browser", true);
|
||||
|
||||
pref("browser.chromeURL","chrome://browser/content/");
|
||||
pref("browser.hiddenWindowChromeURL", "chrome://browser/content/hiddenWindow.xul");
|
||||
pref("xpinstall.dialog.confirm", "chrome://mozapps/content/xpinstall/xpinstallConfirm.xul");
|
||||
pref("xpinstall.dialog.progress", "chrome://mozapps/content/downloads/downloads.xul");
|
||||
pref("xpinstall.dialog.progress.type", "Download:Manager");
|
||||
|
||||
pref("keyword.enabled", true);
|
||||
pref("keyword.URL", "http://www.google.com/search?btnI=I%27m+Feeling+Lucky&ie=UTF-8&oe=UTF-8&q=");
|
||||
|
||||
pref("general.useragent.locale", "chrome://global/locale/intl.properties");
|
||||
pref("general.useragent.contentlocale", "chrome://browser-region/locale/region.properties");
|
||||
pref("general.useragent.vendor", "Firebird");
|
||||
pref("general.useragent.vendorSub",
|
||||
#expand __APP_VERSION__
|
||||
);
|
||||
|
||||
pref("general.smoothScroll", false);
|
||||
#ifdef XP_UNIX
|
||||
pref("general.autoScroll", false);
|
||||
#else
|
||||
pref("general.autoScroll", true);
|
||||
#endif
|
||||
|
||||
// 0 = blank, 1 = home (browser.startup.homepage), 2 = last
|
||||
// XXXBlake Remove this stupid pref
|
||||
pref("browser.startup.page", 1);
|
||||
pref("browser.startup.homepage", "chrome://browser-region/locale/region.properties");
|
||||
// "browser.startup.homepage_override" was for 4.x
|
||||
pref("browser.startup.homepage_override.1", false);
|
||||
|
||||
pref("browser.cache.disk.capacity", 50000);
|
||||
pref("browser.enable_automatic_image_resizing", true);
|
||||
pref("browser.urlbar.matchOnlyTyped", false);
|
||||
pref("browser.chrome.site_icons", true);
|
||||
pref("browser.chrome.favicons", true);
|
||||
pref("browser.turbo.enabled", false);
|
||||
pref("browser.formfill.enable", true);
|
||||
|
||||
pref("browser.download.useDownloadDir", true);
|
||||
pref("browser.download.folderList", 0);
|
||||
pref("browser.download.manager.showAlertOnComplete", true);
|
||||
pref("browser.download.manager.showAlertInterval", 2000);
|
||||
pref("browser.download.manager.retention", 2);
|
||||
pref("browser.download.manager.showWhenStarting", true);
|
||||
pref("browser.download.manager.useWindow", true);
|
||||
pref("browser.download.manager.closeWhenDone", true);
|
||||
pref("browser.download.manager.openDelay", 500);
|
||||
|
||||
// pointer to the default engine name
|
||||
pref("browser.search.defaultenginename", "chrome://browser-region/locale/region.properties");
|
||||
// pointer to the Web Search url (content area context menu)
|
||||
pref("browser.search.defaulturl", "chrome://browser-region/locale/region.properties");
|
||||
|
||||
// basic search popup constraint: minimum sherlock plugin version displayed
|
||||
// (note: must be a string representation of a float or it'll default to 0.0)
|
||||
pref("browser.search.basic.min_ver", "0.0");
|
||||
|
||||
pref("browser.history.grouping", "day");
|
||||
pref("browser.sessionhistory.max_entries", 50);
|
||||
|
||||
// Tab browser preferences.
|
||||
pref("browser.tabs.loadInBackground", true);
|
||||
pref("browser.tabs.loadFolderAndReplace", true);
|
||||
pref("browser.tabs.opentabfor.middleclick", true);
|
||||
pref("browser.tabs.opentabfor.urlbar", true);
|
||||
|
||||
// Smart Browsing prefs
|
||||
pref("browser.related.enabled", true);
|
||||
pref("browser.related.autoload", 1); // 0 = Always, 1 = After first use, 2 = Never
|
||||
pref("browser.related.provider", "http://www-rl.netscape.com/wtgn?");
|
||||
pref("browser.related.disabledForDomains", "");
|
||||
pref("browser.goBrowsing.enabled", true);
|
||||
|
||||
// Default bookmark sorting
|
||||
pref("browser.bookmarks.sort.direction", "descending");
|
||||
pref("browser.bookmarks.sort.resource", "rdf:http://home.netscape.com/NC-rdf#Name");
|
||||
|
||||
// Scripts & Windows prefs
|
||||
pref("dom.disable_open_during_load", true);
|
||||
pref("javascript.options.showInConsole", false);
|
||||
|
||||
// popups.policy 1=allow,2=reject
|
||||
pref("privacy.popups.policy", 1);
|
||||
pref("privacy.popups.usecustom", true);
|
||||
pref("privacy.popups.firstTime", true);
|
||||
|
||||
pref("network.protocols.useSystemDefaults", false); // set to true if user links should use system default handlers
|
||||
pref("network.cookie.cookieBehavior", 0); // cookies enabled
|
||||
pref("network.cookie.enableForCurrentSessionOnly", false);
|
||||
|
||||
pref("imageblocker.enabled", true);
|
||||
|
||||
// l12n and i18n
|
||||
pref("intl.accept_languages", "chrome://global/locale/intl.properties");
|
||||
// collationOption is only set on linux for japanese. see bug 18338 and 62015
|
||||
// we need to check if this pref is still useful.
|
||||
pref("intl.collationOption", "chrome://global-platform/locale/intl.properties");
|
||||
pref("intl.charsetmenu.browser.static", "chrome://global/locale/intl.properties");
|
||||
pref("intl.charsetmenu.browser.more1", "chrome://global/locale/intl.properties");
|
||||
pref("intl.charsetmenu.browser.more2", "chrome://global/locale/intl.properties");
|
||||
pref("intl.charsetmenu.browser.more3", "chrome://global/locale/intl.properties");
|
||||
pref("intl.charsetmenu.browser.more4", "chrome://global/locale/intl.properties");
|
||||
pref("intl.charsetmenu.browser.more5", "chrome://global/locale/intl.properties");
|
||||
pref("intl.charset.detector", "chrome://global/locale/intl.properties");
|
||||
pref("intl.charset.default", "chrome://global-platform/locale/intl.properties");
|
||||
pref("font.language.group", "chrome://global/locale/intl.properties");
|
||||
pref("intl.menuitems.alwaysappendaccesskeys","chrome://global/locale/intl.properties");
|
||||
|
||||
// 0=lines, 1=pages, 2=history , 3=text size
|
||||
pref("mousewheel.withcontrolkey.action",3);
|
||||
pref("mousewheel.withshiftkey.action",2);
|
||||
pref("mousewheel.withaltkey.action",0);
|
||||
|
||||
pref("profile.allow_automigration", false); // setting to false bypasses automigration in the profile code
|
||||
|
||||
// Customizable toolbar stuff
|
||||
pref("custtoolbar.personal_toolbar_folder", "");
|
||||
pref("browser.throbber.url","chrome://browser-region/locale/region.properties");
|
||||
|
||||
// pref to control the alert notification
|
||||
pref("alerts.slideIncrement", 1);
|
||||
pref("alerts.slideIncrementTime", 10);
|
||||
pref("alerts.totalOpenTime", 4000);
|
||||
pref("alerts.height", 50);
|
||||
|
||||
// update notifications prefs
|
||||
pref("update_notifications.enabled", true);
|
||||
pref("update_notifications.provider.0.frequency", 7); // number of days
|
||||
pref("update_notifications.provider.0.datasource", "chrome://browser-region/locale/region.properties");
|
||||
|
||||
pref("browser.xul.error_pages.enabled", false);
|
||||
|
||||
pref("signon.rememberSignons", true);
|
||||
pref("signon.expireMasterPassword", false);
|
||||
pref("signon.SignonFileName", "signons.txt");
|
||||
|
||||
pref("network.protocol-handler.external.mailto", true); // for mail
|
||||
pref("network.protocol-handler.external.news" , true); // for news
|
||||
|
||||
// By default, all protocol handlers are exposed. This means that
|
||||
// the browser will respond to openURL commands for all URL types.
|
||||
// It will also try to open link clicks inside the browser before
|
||||
// failing over to the system handlers.
|
||||
pref("network.protocol-handler.expose-all", true);
|
||||
|
||||
// Default security warning dialogs to show once.
|
||||
pref("security.warn_entering_secure.show_once", true);
|
||||
pref("security.warn_entering_weak.show_once", true);
|
||||
pref("security.warn_leaving_secure.show_once", true);
|
||||
pref("security.warn_viewing_mixed.show_once", true);
|
||||
pref("security.warn_submit_insecure.show_once", true);
|
|
@ -469,7 +469,6 @@ pref("network.enablePad", false); // Allow client to do proxy
|
|||
pref("network.enableIDN", true); // Turn on/off IDN (Internationalized Domain Name) resolution
|
||||
pref("converter.html2txt.structs", true); // Output structured phrases (strong, em, code, sub, sup, b, i, u)
|
||||
pref("converter.html2txt.header_strategy", 1); // 0 = no indention; 1 = indention, increased with header level; 2 = numbering and slight indention
|
||||
pref("imageblocker.enabled", true);
|
||||
|
||||
// l12n and i18n
|
||||
pref("intl.accept_languages", "chrome://global/locale/intl.properties");
|
||||
|
|
|
@ -58,11 +58,9 @@
|
|||
|
||||
static const char kImageBehaviorPrefName[] = "network.image.imageBehavior";
|
||||
static const char kImageWarningPrefName[] = "network.image.warnAboutImages";
|
||||
static const char kImageBlockerPrefName[] = "imageblocker.enabled";
|
||||
static const char kImageBlockImageInMailNewsPrefName[] = "mailnews.message_display.disable_remote_image";
|
||||
|
||||
static const PRUint8 kImageBehaviorPrefDefault = IMAGE_ACCEPT;
|
||||
static const PRPackedBool kImageBlockerPrefDefault = PR_FALSE;
|
||||
static const PRPackedBool kImageWarningPrefDefault = PR_FALSE;
|
||||
static const PRPackedBool kImageBlockImageInMailNewsPrefDefault = PR_FALSE;
|
||||
|
||||
|
@ -100,7 +98,6 @@ NS_IMPL_ISUPPORTS4(nsImgManager,
|
|||
|
||||
nsImgManager::nsImgManager()
|
||||
: mBehaviorPref(kImageBehaviorPrefDefault)
|
||||
, mBlockerPref(kImageBlockerPrefDefault)
|
||||
, mWarningPref(kImageWarningPrefDefault)
|
||||
, mBlockInMailNewsPref(kImageBlockImageInMailNewsPrefDefault)
|
||||
{
|
||||
|
@ -123,8 +120,6 @@ nsresult nsImgManager::Init()
|
|||
// We don't do anything with it yet, but let it be. (bug 110112, 146513)
|
||||
prefBranch->AddObserver(kImageWarningPrefName, this, PR_TRUE);
|
||||
|
||||
// What is this pref, and how do you set it?
|
||||
prefBranch->AddObserver(kImageBlockerPrefName, this, PR_TRUE);
|
||||
prefBranch->AddObserver(kImageBlockImageInMailNewsPrefName, this, PR_TRUE);
|
||||
|
||||
PrefChanged(prefBranch, nsnull);
|
||||
|
@ -146,10 +141,6 @@ nsImgManager::PrefChanged(nsIPrefBranch *aPrefBranch,
|
|||
val >= 0 && val <= 2)
|
||||
mBehaviorPref = val;
|
||||
|
||||
if (PREF_CHANGED(kImageBlockerPrefName) &&
|
||||
NS_SUCCEEDED(aPrefBranch->GetBoolPref(kImageBlockerPrefName, &val)))
|
||||
mBlockerPref = val;
|
||||
|
||||
if (PREF_CHANGED(kImageWarningPrefName) &&
|
||||
NS_SUCCEEDED(aPrefBranch->GetBoolPref(kImageWarningPrefName, &val)))
|
||||
mWarningPref = val;
|
||||
|
@ -255,13 +246,6 @@ nsImgManager::TestPermission(nsIURI *aCurrentURI,
|
|||
nsresult rv;
|
||||
*aPermission = PR_TRUE;
|
||||
|
||||
// return if imageblocker is not enabled
|
||||
// TODO: Why? Where is the pref set?
|
||||
if (!mBlockerPref) {
|
||||
*aPermission = (mBehaviorPref != IMAGE_DENY);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// check the permission list first; if we find an entry, it overrides
|
||||
// default prefs. this is new behavior, see bug 184059.
|
||||
if (mPermissionManager) {
|
||||
|
|
|
@ -69,13 +69,12 @@ public:
|
|||
protected:
|
||||
|
||||
void PrefChanged(nsIPrefBranch *, const char *);
|
||||
|
||||
nsCOMPtr<nsIPermissionManager> mPermissionManager;
|
||||
|
||||
PRUint8 mBehaviorPref;
|
||||
PRPackedBool mBlockerPref;
|
||||
PRPackedBool mWarningPref;
|
||||
PRPackedBool mBlockInMailNewsPref;
|
||||
|
||||
nsCOMPtr<nsIPermissionManager> mPermissionManager;
|
||||
};
|
||||
|
||||
// {D60B3710-166D-11d5-A542-0010A401EB10}
|
||||
|
|
|
@ -55,17 +55,6 @@
|
|||
return permissionmanager.testPermission(uri, "image") != nsIPermissionManager.DENY_ACTION;
|
||||
},
|
||||
|
||||
// Determine if "imageBlocker.enabled" pref is set
|
||||
isPrefSet: function () {
|
||||
var pref = gContextMenu.getService('@mozilla.org/preferences-service;1', 'nsIPrefBranch');
|
||||
var result = false;
|
||||
try {
|
||||
result = pref.getBoolPref( "imageblocker.enabled" );
|
||||
} catch(e) {
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
// Block image from loading in the future.
|
||||
blockImage : function () {
|
||||
const nsIPermissionManager = Components.interfaces.nsIPermissionManager;
|
||||
|
@ -103,13 +92,11 @@
|
|||
|
||||
gContextMenu.showItem
|
||||
("context-blockimage",
|
||||
gContextMenu.onImage && cookieContextMenu.isPrefSet() &&
|
||||
cookieContextMenu.isBlockingImages());
|
||||
gContextMenu.onImage && cookieContextMenu.isBlockingImages());
|
||||
|
||||
gContextMenu.showItem
|
||||
("context-unblockimage",
|
||||
gContextMenu.onImage && cookieContextMenu.isPrefSet() &&
|
||||
!cookieContextMenu.isBlockingImages());
|
||||
gContextMenu.onImage && !cookieContextMenu.isBlockingImages());
|
||||
} catch (e) {}
|
||||
},
|
||||
|
||||
|
|
|
@ -42,17 +42,6 @@
|
|||
// see bug 225857 comment 7
|
||||
const ALLOW_SESSION_ONLY = 8;
|
||||
|
||||
// Remove the image entries from the task menu
|
||||
function HideImage() {
|
||||
document.getElementById("image").hidden = true;
|
||||
}
|
||||
|
||||
// for some unexplainable reason, CheckForImage() keeps getting called repeatedly
|
||||
// as we mouse over the task menu. IMO, that shouldn't be happening. To avoid
|
||||
// taking a performance hit due to this, we will set the following flag to avoid
|
||||
// reexecuting the routine
|
||||
var alreadyCheckedForImage = false;
|
||||
|
||||
// determine which items we need to hide or disable from the task menu
|
||||
function CheckForVisibility()
|
||||
{
|
||||
|
@ -85,20 +74,6 @@
|
|||
pref = Components.classes['@mozilla.org/preferences-service;1'];
|
||||
pref = pref.getService();
|
||||
pref = pref.QueryInterface(Components.interfaces.nsIPrefBranch);
|
||||
|
||||
// determine if image manager should be in the UI
|
||||
if (alreadyCheckedForImage) {
|
||||
return;
|
||||
}
|
||||
alreadyCheckedForImage = true;
|
||||
// remove image functions (unless overruled by the "imageblocker.enabled" pref)
|
||||
try {
|
||||
if (!pref.getBoolPref("imageblocker.enabled")) {
|
||||
HideImage();
|
||||
}
|
||||
} catch(e) {
|
||||
HideImage();
|
||||
}
|
||||
}
|
||||
|
||||
function SetPopupMenuEnabledState() {
|
||||
|
|
|
@ -46,29 +46,9 @@
|
|||
{
|
||||
parent.initPanel('chrome://cookie/content/pref-images.xul');
|
||||
|
||||
imageBlockingEnabled();
|
||||
setDisables();
|
||||
}
|
||||
|
||||
// Present finer control over image loading to the user.
|
||||
// enable image blocker if "imageblocker.enabled" pref is true
|
||||
function imageBlockingEnabled()
|
||||
{
|
||||
var enabled;
|
||||
try {
|
||||
enabled = parent.hPrefWindow.getPref("bool", "imageblocker.enabled");
|
||||
}
|
||||
catch(ex) {
|
||||
enabled = false;
|
||||
}
|
||||
if (!enabled)
|
||||
{
|
||||
document.getElementById("haveImageBlocking").setAttribute("hidden", "true");
|
||||
if (!document.getElementById("networkImageDisableImagesInMailNews"))
|
||||
document.getElementById("haveImageBlockingOrMailnews").setAttribute("hidden", "true");
|
||||
}
|
||||
}
|
||||
|
||||
function setDisables()
|
||||
{
|
||||
var imageBehavior = document.getElementById("networkImageBehaviour");
|
||||
|
|
|
@ -193,7 +193,6 @@ pref("wallet.phonePanel.hide", false);
|
|||
pref("wallet.creditPanel.hide", false);
|
||||
pref("wallet.employPanel.hide", false);
|
||||
pref("wallet.miscPanel.hide", false);
|
||||
pref("imageblocker.enabled", true);
|
||||
|
||||
// -- folders (Mac: these are binary aliases.)
|
||||
pref("mail.signature_file", "");
|
||||
|
|
|
@ -149,8 +149,6 @@ pref("wallet.creditPanel.hide", false);
|
|||
pref("wallet.employPanel.hide", false);
|
||||
pref("wallet.miscPanel.hide", false);
|
||||
|
||||
pref("imageblocker.enabled", true);
|
||||
|
||||
// -- folders (Mac: these are binary aliases.)
|
||||
pref("mail.signature_file", "");
|
||||
pref("mail.directory", "");
|
||||
|
|
|
@ -55,17 +55,6 @@
|
|||
return permissionmanager.testPermission(uri, "image") != nsIPermissionManager.DENY_ACTION;
|
||||
},
|
||||
|
||||
// Determine if "imageBlocker.enabled" pref is set
|
||||
isPrefSet: function () {
|
||||
var pref = gContextMenu.getService('@mozilla.org/preferences-service;1', 'nsIPrefBranch');
|
||||
var result = false;
|
||||
try {
|
||||
result = pref.getBoolPref( "imageblocker.enabled" );
|
||||
} catch(e) {
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
// Block image from loading in the future.
|
||||
blockImage : function () {
|
||||
const nsIPermissionManager = Components.interfaces.nsIPermissionManager;
|
||||
|
@ -103,13 +92,11 @@
|
|||
|
||||
gContextMenu.showItem
|
||||
("context-blockimage",
|
||||
gContextMenu.onImage && cookieContextMenu.isPrefSet() &&
|
||||
cookieContextMenu.isBlockingImages());
|
||||
gContextMenu.onImage && cookieContextMenu.isBlockingImages());
|
||||
|
||||
gContextMenu.showItem
|
||||
("context-unblockimage",
|
||||
gContextMenu.onImage && cookieContextMenu.isPrefSet() &&
|
||||
!cookieContextMenu.isBlockingImages());
|
||||
gContextMenu.onImage && !cookieContextMenu.isBlockingImages());
|
||||
} catch (e) {}
|
||||
},
|
||||
|
||||
|
|
|
@ -42,17 +42,6 @@
|
|||
// see bug 225857 comment 7
|
||||
const ALLOW_SESSION_ONLY = 8;
|
||||
|
||||
// Remove the image entries from the task menu
|
||||
function HideImage() {
|
||||
document.getElementById("image").hidden = true;
|
||||
}
|
||||
|
||||
// for some unexplainable reason, CheckForImage() keeps getting called repeatedly
|
||||
// as we mouse over the task menu. IMO, that shouldn't be happening. To avoid
|
||||
// taking a performance hit due to this, we will set the following flag to avoid
|
||||
// reexecuting the routine
|
||||
var alreadyCheckedForImage = false;
|
||||
|
||||
// determine which items we need to hide or disable from the task menu
|
||||
function CheckForVisibility()
|
||||
{
|
||||
|
@ -85,20 +74,6 @@
|
|||
pref = Components.classes['@mozilla.org/preferences-service;1'];
|
||||
pref = pref.getService();
|
||||
pref = pref.QueryInterface(Components.interfaces.nsIPrefBranch);
|
||||
|
||||
// determine if image manager should be in the UI
|
||||
if (alreadyCheckedForImage) {
|
||||
return;
|
||||
}
|
||||
alreadyCheckedForImage = true;
|
||||
// remove image functions (unless overruled by the "imageblocker.enabled" pref)
|
||||
try {
|
||||
if (!pref.getBoolPref("imageblocker.enabled")) {
|
||||
HideImage();
|
||||
}
|
||||
} catch(e) {
|
||||
HideImage();
|
||||
}
|
||||
}
|
||||
|
||||
function SetPopupMenuEnabledState() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче