2005-02-25 12:07:58 +03:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
2005-09-13 22:40:56 +04:00
|
|
|
# ***** BEGIN LICENSE BLOCK *****
|
2005-02-25 12:07:58 +03:00
|
|
|
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
2005-09-13 22:40:56 +04:00
|
|
|
#
|
2005-02-25 12:07:58 +03:00
|
|
|
# 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/
|
2005-09-13 22:40:56 +04:00
|
|
|
#
|
2005-02-25 12:07:58 +03:00
|
|
|
# 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.
|
2005-09-13 22:40:56 +04:00
|
|
|
#
|
2005-02-25 12:07:58 +03:00
|
|
|
# The Original Code is the Firefox Sanitizer.
|
2005-09-13 22:40:56 +04:00
|
|
|
#
|
|
|
|
# The Initial Developer of the Original Code is
|
|
|
|
# Ben Goodger.
|
2005-02-25 12:07:58 +03:00
|
|
|
# Portions created by the Initial Developer are Copyright (C) 2005
|
|
|
|
# the Initial Developer. All Rights Reserved.
|
2005-09-13 22:40:56 +04:00
|
|
|
#
|
2005-02-25 12:07:58 +03:00
|
|
|
# Contributor(s):
|
|
|
|
# Ben Goodger <ben@mozilla.org>
|
2005-08-23 20:38:28 +04:00
|
|
|
# Giorgio Maone <g.maone@informaction.com>
|
2008-11-06 06:57:00 +03:00
|
|
|
# Johnathan Nightingale <johnath@mozilla.com>
|
2005-09-13 22:40:56 +04:00
|
|
|
#
|
2005-02-25 12:07:58 +03:00
|
|
|
# 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.
|
2005-09-13 22:40:56 +04:00
|
|
|
#
|
2005-02-25 12:07:58 +03:00
|
|
|
# ***** END LICENSE BLOCK *****
|
|
|
|
|
|
|
|
<?xml-stylesheet href="chrome://global/skin/"?>
|
2008-11-06 06:57:00 +03:00
|
|
|
<?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css" type="text/css"?>
|
2005-02-25 12:07:58 +03:00
|
|
|
|
2005-02-27 09:39:44 +03:00
|
|
|
<!DOCTYPE prefwindow [
|
2005-03-10 21:44:11 +03:00
|
|
|
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
|
2005-02-25 12:07:58 +03:00
|
|
|
<!ENTITY % sanitizeDTD SYSTEM "chrome://browser/locale/sanitize.dtd">
|
|
|
|
%brandDTD;
|
|
|
|
%sanitizeDTD;
|
|
|
|
]>
|
|
|
|
|
|
|
|
<prefwindow id="SanitizeDialog" type="child"
|
|
|
|
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
|
|
|
dlgbuttons="accept,cancel"
|
2008-11-06 06:57:00 +03:00
|
|
|
title="&sanitizeDialog2.title;"
|
2009-03-20 08:30:29 +03:00
|
|
|
style="width: &dialog.width;;"
|
2005-02-25 12:07:58 +03:00
|
|
|
ondialogaccept="gSanitizePromptDialog.sanitize();">
|
|
|
|
|
2005-08-05 10:27:30 +04:00
|
|
|
<prefpane id="SanitizeDialogPane" onpaneload="gSanitizePromptDialog.init();">
|
2005-02-25 12:07:58 +03:00
|
|
|
<stringbundle id="bundleBrowser" src="chrome://browser/locale/browser.properties"/>
|
|
|
|
|
|
|
|
<script type="application/x-javascript" src="chrome://browser/content/sanitize.js"/>
|
|
|
|
<script type="application/x-javascript">
|
|
|
|
<![CDATA[
|
|
|
|
var gSanitizePromptDialog = {
|
|
|
|
init: function ()
|
|
|
|
{
|
2008-11-06 06:57:00 +03:00
|
|
|
this.checkPrefs();
|
2005-02-25 12:07:58 +03:00
|
|
|
var s = new Sanitizer();
|
2008-11-06 06:57:00 +03:00
|
|
|
s.prefDomain = "privacy.cpd.";
|
2005-02-25 12:07:58 +03:00
|
|
|
var sanitizePreferences = document.getElementById("sanitizePreferences");
|
|
|
|
for (var i = 0; i < sanitizePreferences.childNodes.length; ++i) {
|
|
|
|
var preference = sanitizePreferences.childNodes[i];
|
|
|
|
var name = s.getNameFromPreference(preference.name);
|
|
|
|
if (!s.canClearItem(name))
|
|
|
|
preference.disabled = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
var bundleBrowser = document.getElementById("bundleBrowser");
|
2009-03-20 08:30:29 +03:00
|
|
|
document.documentElement.getButton("accept").label = bundleBrowser.getString("sanitizeButtonOK");
|
2005-02-25 12:07:58 +03:00
|
|
|
},
|
|
|
|
|
2008-11-06 06:57:00 +03:00
|
|
|
checkPrefs : function ()
|
|
|
|
{
|
|
|
|
var prefService = Components.classes["@mozilla.org/preferences-service;1"]
|
|
|
|
.getService(Components.interfaces.nsIPrefService);
|
|
|
|
var cpdBranch = prefService.getBranch("privacy.cpd.");
|
|
|
|
|
|
|
|
// If we don't have defaults for the privacy.cpd branch,
|
|
|
|
// clone the privacy.item (clear at shutdown) defaults
|
|
|
|
if (cpdBranch.prefHasUserValue("history"))
|
|
|
|
return;
|
|
|
|
|
|
|
|
var itemBranch = prefService.getBranch("privacy.item.");
|
|
|
|
var itemCount = { value: 0 };
|
|
|
|
var itemArray = itemBranch.getChildList("", itemCount);
|
|
|
|
itemArray.forEach(function (name) {
|
|
|
|
cpdBranch.setBoolPref(name, itemBranch.getBoolPref(name));
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
2005-02-25 12:07:58 +03:00
|
|
|
sanitize: function ()
|
|
|
|
{
|
2008-11-12 16:58:24 +03:00
|
|
|
// Update pref values before handing off to the sanitizer (bug 453440)
|
|
|
|
this.updatePrefs();
|
2005-02-25 12:07:58 +03:00
|
|
|
var s = new Sanitizer();
|
2008-11-06 06:57:00 +03:00
|
|
|
s.ignoreTimespan = false;
|
|
|
|
s.prefDomain = "privacy.cpd.";
|
2008-11-12 16:58:24 +03:00
|
|
|
try {
|
|
|
|
s.sanitize();
|
|
|
|
} catch (er) {
|
|
|
|
Components.utils.reportError("Exception during sanitize: " + er);
|
|
|
|
}
|
|
|
|
return true;
|
2005-02-25 12:07:58 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
onReadGeneric: function ()
|
|
|
|
{
|
|
|
|
var preferences = document.getElementById("sanitizePreferences");
|
|
|
|
var found = false;
|
|
|
|
for (var i = 0; i < preferences.childNodes.length; ++i) {
|
|
|
|
var preference = preferences.childNodes[i];
|
|
|
|
if (preference.value && !preference.disabled) {
|
|
|
|
found = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
document.documentElement.getButton("accept").disabled = !found;
|
|
|
|
}
|
|
|
|
catch (e) { }
|
|
|
|
return undefined;
|
2008-05-05 23:54:29 +04:00
|
|
|
},
|
|
|
|
|
2008-05-06 22:52:09 +04:00
|
|
|
onReadDownloads: function (aEvent)
|
|
|
|
{
|
|
|
|
// Call the common function that will update the accept button if needed
|
|
|
|
this.onReadGeneric();
|
|
|
|
|
2008-11-06 06:57:00 +03:00
|
|
|
let historyPref = document.getElementById("privacy.cpd.history")
|
|
|
|
let downloadPref = document.getElementById("privacy.cpd.downloads");
|
2008-05-06 22:52:09 +04:00
|
|
|
|
|
|
|
// Disable the checkbox if history is selected
|
|
|
|
let downloads = document.getElementById("downloads-checkbox");
|
|
|
|
downloads.disabled = historyPref.value;
|
|
|
|
|
|
|
|
// The "Download History" checkbox is selected if either of the history or
|
|
|
|
// downloads preferences are true.
|
|
|
|
return historyPref.value || downloadPref.value;
|
|
|
|
},
|
|
|
|
|
2008-05-05 23:54:29 +04:00
|
|
|
updateDownloadHistory: function ()
|
|
|
|
{
|
|
|
|
// When toggling history, we automatically clear download history too,
|
2008-05-06 22:52:09 +04:00
|
|
|
// so we disable that control and set its value to true.
|
2008-05-05 23:54:29 +04:00
|
|
|
let downloads = document.getElementById("downloads-checkbox");
|
|
|
|
let history = document.getElementById("history-checkbox");
|
|
|
|
let s = new Sanitizer();
|
|
|
|
downloads.disabled = history.checked ||
|
|
|
|
!s.canClearItem("downloads");
|
2008-05-06 22:52:09 +04:00
|
|
|
if (history.checked)
|
|
|
|
downloads.checked = true;
|
2008-05-05 23:54:29 +04:00
|
|
|
},
|
2008-11-12 16:58:24 +03:00
|
|
|
|
|
|
|
updatePrefs : function ()
|
|
|
|
{
|
|
|
|
var tsPref = document.getElementById("privacy.sanitize.timeSpan");
|
|
|
|
Sanitizer.prefs.setIntPref("timeSpan", tsPref.value);
|
|
|
|
var sanitizePreferences = document.getElementById("sanitizePreferences");
|
|
|
|
var prefs = sanitizePreferences.rootBranch;
|
|
|
|
for (var i = 0; i < sanitizePreferences.childNodes.length; ++i) {
|
|
|
|
var p = sanitizePreferences.childNodes[i];
|
|
|
|
prefs.setBoolPref(p.name, p.value);
|
|
|
|
}
|
|
|
|
}
|
2005-02-25 12:07:58 +03:00
|
|
|
};
|
|
|
|
]]>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<preferences id="sanitizePreferences">
|
2008-11-06 06:57:00 +03:00
|
|
|
<preference id="privacy.cpd.history" name="privacy.cpd.history" type="bool"/>
|
|
|
|
<preference id="privacy.cpd.formdata" name="privacy.cpd.formdata" type="bool"/>
|
|
|
|
<preference id="privacy.cpd.passwords" name="privacy.cpd.passwords" type="bool"/>
|
|
|
|
<preference id="privacy.cpd.downloads" name="privacy.cpd.downloads" type="bool"/>
|
|
|
|
<preference id="privacy.cpd.cookies" name="privacy.cpd.cookies" type="bool"/>
|
|
|
|
<preference id="privacy.cpd.cache" name="privacy.cpd.cache" type="bool"/>
|
|
|
|
<preference id="privacy.cpd.offlineApps" name="privacy.cpd.offlineApps" type="bool"/>
|
|
|
|
<preference id="privacy.cpd.sessions" name="privacy.cpd.sessions" type="bool"/>
|
2009-01-20 18:59:49 +03:00
|
|
|
<preference id="privacy.cpd.siteSettings" name="privacy.cpd.siteSettings" type="bool"/>
|
2008-11-06 06:57:00 +03:00
|
|
|
</preferences>
|
|
|
|
|
|
|
|
<preferences id="nonItemPreferences">
|
|
|
|
<preference id="privacy.sanitize.timeSpan"
|
|
|
|
name="privacy.sanitize.timeSpan"
|
|
|
|
type="int"/>
|
2005-02-25 12:07:58 +03:00
|
|
|
</preferences>
|
|
|
|
|
2008-11-06 06:57:00 +03:00
|
|
|
<groupbox orient="vertical">
|
|
|
|
<caption label="&historySection.label;"/>
|
2008-11-16 21:24:35 +03:00
|
|
|
<hbox id="SanitizeDurationBox" align="center">
|
2009-03-20 08:30:29 +03:00
|
|
|
<label value="&clearTimeDuration.label;" control="sanitizeDurationChoice"
|
|
|
|
accesskey="&clearTimeDuration.accesskey;" id="sanitizeDurationLabel"/>
|
2008-11-06 06:57:00 +03:00
|
|
|
<menulist id="sanitizeDurationChoice"
|
|
|
|
preference="privacy.sanitize.timeSpan">
|
|
|
|
<menupopup>
|
2009-03-20 08:30:29 +03:00
|
|
|
<menuitem label="&clearTimeDuration.lastHour;" value="1"/>
|
|
|
|
<menuitem label="&clearTimeDuration.last2Hours;" value="2"/>
|
|
|
|
<menuitem label="&clearTimeDuration.last4Hours;" value="3"/>
|
|
|
|
<menuitem label="&clearTimeDuration.today;" value="4"/>
|
2008-11-06 06:57:00 +03:00
|
|
|
<menuseparator/>
|
2009-03-20 08:30:29 +03:00
|
|
|
<menuitem label="&clearTimeDuration.everything;" value="0"/>
|
2008-11-06 06:57:00 +03:00
|
|
|
</menupopup>
|
|
|
|
</menulist>
|
2009-03-20 08:30:29 +03:00
|
|
|
<label value="&clearTimeDuration.suffix;" flex="1"/>
|
2008-11-06 06:57:00 +03:00
|
|
|
</hbox>
|
|
|
|
<hbox>
|
|
|
|
<vbox style="width: &column.width;">
|
|
|
|
<checkbox id="history-checkbox"
|
2009-03-20 08:30:29 +03:00
|
|
|
label="&itemBrowsingHistory.label;"
|
|
|
|
accesskey="&itemBrowsingHistory.accesskey;"
|
2008-11-06 06:57:00 +03:00
|
|
|
preference="privacy.cpd.history"
|
|
|
|
oncommand="gSanitizePromptDialog.updateDownloadHistory();"
|
|
|
|
onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
|
|
|
|
<checkbox id="downloads-checkbox"
|
2009-03-20 08:30:29 +03:00
|
|
|
label="&itemDownloadHistory.label;"
|
|
|
|
accesskey="&itemDownloadHistory.accesskey;"
|
2008-11-06 06:57:00 +03:00
|
|
|
preference="privacy.cpd.downloads"
|
|
|
|
onsyncfrompreference="return gSanitizePromptDialog.onReadDownloads();"/>
|
2009-03-20 08:30:29 +03:00
|
|
|
<checkbox label="&itemFormSearchHistory.label;"
|
|
|
|
accesskey="&itemFormSearchHistory.accesskey;"
|
2008-11-06 06:57:00 +03:00
|
|
|
preference="privacy.cpd.formdata"
|
|
|
|
onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
|
|
|
|
</vbox>
|
|
|
|
<vbox style="width: &column.width;">
|
|
|
|
<checkbox label="&itemCookies.label;"
|
|
|
|
accesskey="&itemCookies.accesskey;"
|
|
|
|
preference="privacy.cpd.cookies"
|
|
|
|
onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
|
|
|
|
<checkbox label="&itemActiveLogins.label;"
|
|
|
|
accesskey="&itemActiveLogins.accesskey;"
|
|
|
|
preference="privacy.cpd.sessions"
|
|
|
|
onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
|
2009-03-20 08:30:29 +03:00
|
|
|
<checkbox label="&itemCache.label;"
|
|
|
|
accesskey="&itemCache.accesskey;"
|
2008-11-06 06:57:00 +03:00
|
|
|
preference="privacy.cpd.cache"
|
|
|
|
onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
|
|
|
|
</vbox>
|
|
|
|
</hbox>
|
|
|
|
</groupbox>
|
|
|
|
<groupbox orient="horizontal">
|
|
|
|
<caption label="&dataSection.label;"/>
|
|
|
|
<vbox style="width: &column.width;">
|
|
|
|
<checkbox label="&itemPasswords.label;"
|
|
|
|
accesskey="&itemPasswords.accesskey;"
|
|
|
|
preference="privacy.cpd.passwords"
|
|
|
|
onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
|
2009-03-20 08:30:29 +03:00
|
|
|
<checkbox label="&itemSitePreferences.label;"
|
|
|
|
accesskey="&itemSitePreferences.accesskey;"
|
2009-01-20 18:59:49 +03:00
|
|
|
preference="privacy.cpd.siteSettings"
|
|
|
|
onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
|
2008-11-06 06:57:00 +03:00
|
|
|
</vbox>
|
|
|
|
<vbox style="width: &column.width;">
|
|
|
|
<checkbox label="&itemOfflineApps.label;"
|
|
|
|
accesskey="&itemOfflineApps.accesskey;"
|
|
|
|
preference="privacy.cpd.offlineApps"
|
|
|
|
onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
|
|
|
|
</vbox>
|
|
|
|
</groupbox>
|
2006-08-05 01:35:18 +04:00
|
|
|
|
2005-02-25 12:07:58 +03:00
|
|
|
</prefpane>
|
|
|
|
</prefwindow>
|