[Pkg-mozext-commits] [cookie-monster] 01/05: Imported Upstream version 1.3.0.0
David Prévot
taffit at moszumanska.debian.org
Sat Jan 9 19:15:01 UTC 2016
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository cookie-monster.
commit 340b668f619b6a9cb696458f112026d38bd43a68
Author: David Prévot <david at tilapin.org>
Date: Sat Jan 9 14:56:49 2016 -0400
Imported Upstream version 1.3.0.0
---
META-INF/manifest.mf | 22 +
META-INF/mozilla.rsa | Bin 0 -> 4197 bytes
META-INF/mozilla.sf | 4 +
chrome.manifest | 1 +
chrome/cookiemonster.jar!/content/cookieInfo.js | 273 ++++++----
chrome/cookiemonster.jar!/content/cookieMonster.js | 562 +++++++++++----------
.../content/cookiePreferences.js | 45 +-
chrome/cookiemonster.jar!/content/cookieRequest.js | 67 ++-
.../cookiemonster.jar!/content/cookieTempAllow.js | 135 ++---
chrome/cookiemonster.jar!/content/cookieUtils.js | 20 +-
chrome/cookiemonster.jar!/content/options.xul | 4 +-
chrome/cookiemonster.jar!/content/overlay.js | 73 ++-
chrome/cookiemonster.jar!/content/overlay.xul | 137 ++---
.../cookiemonster.jar!/content/overlay_toolbar.xul | 125 ++---
chrome/cookiemonster.jar!/content/siteCookies.xul | 4 +-
chrome/cookiemonster.jar!/locale/de-DE/options.dtd | 3 +-
chrome/cookiemonster.jar!/locale/de-DE/overlay.dtd | 1 +
chrome/cookiemonster.jar!/locale/en-US/options.dtd | 3 +-
chrome/cookiemonster.jar!/locale/en-US/overlay.dtd | 1 +
chrome/cookiemonster.jar!/locale/fr-FR/options.dtd | 3 +-
chrome/cookiemonster.jar!/locale/fr-FR/overlay.dtd | 1 +
chrome/cookiemonster.jar!/locale/it-IT/options.dtd | 3 +-
chrome/cookiemonster.jar!/locale/it-IT/overlay.dtd | 1 +
chrome/cookiemonster.jar!/locale/nl-NL/options.dtd | 3 +-
chrome/cookiemonster.jar!/locale/nl-NL/overlay.dtd | 1 +
chrome/cookiemonster.jar!/locale/ru-RU/options.dtd | 3 +-
chrome/cookiemonster.jar!/locale/ru-RU/overlay.dtd | 1 +
.../locale/zh-CN/cookieMonster.dtd | 3 +
.../locale/zh-CN/cookieMonster.properties | 41 ++
chrome/cookiemonster.jar!/locale/zh-CN/options.dtd | 14 +
chrome/cookiemonster.jar!/locale/zh-CN/overlay.dtd | 28 +
.../locale/zh-CN/overrideGlobal.dtd | 18 +
.../locale/zh-CN/siteCookies.properties | 6 +
chrome/cookiemonster.jar!/locale/zh-TW/options.dtd | 3 +-
chrome/cookiemonster.jar!/locale/zh-TW/overlay.dtd | 1 +
chrome/cookiemonster.jar!/skin/overlay.css | 4 +-
defaults/preferences/defaults.js | 1 +
install.rdf | 14 +-
38 files changed, 971 insertions(+), 658 deletions(-)
diff --git a/META-INF/manifest.mf b/META-INF/manifest.mf
new file mode 100644
index 0000000..dbe1420
--- /dev/null
+++ b/META-INF/manifest.mf
@@ -0,0 +1,22 @@
+Manifest-Version: 1.0
+
+Name: install.rdf
+Digest-Algorithms: MD5 SHA1
+MD5-Digest: buD+IqeYgGvnvnccTloQsw==
+SHA1-Digest: yI5tCsiXU1sdch8WA4kDMtrKB+8=
+
+Name: chrome.manifest
+Digest-Algorithms: MD5 SHA1
+MD5-Digest: 8uLKUxdgOz7VtP7SxtzOYw==
+SHA1-Digest: 1sWOPYdQCbQiRQMP5nHUneyinKQ=
+
+Name: chrome/cookiemonster.jar
+Digest-Algorithms: MD5 SHA1
+MD5-Digest: ottpY/DYVOvuwQ1ekm3n8w==
+SHA1-Digest: zXeQiRqkpFPqZAErFfZ4MXm8h+8=
+
+Name: defaults/preferences/defaults.js
+Digest-Algorithms: MD5 SHA1
+MD5-Digest: E0oIoYoQmWBVhVyD8K8ItQ==
+SHA1-Digest: 0hVT9kG2WHd4TxGzSkRLLmaA578=
+
diff --git a/META-INF/mozilla.rsa b/META-INF/mozilla.rsa
new file mode 100644
index 0000000..a2242a6
Binary files /dev/null and b/META-INF/mozilla.rsa differ
diff --git a/META-INF/mozilla.sf b/META-INF/mozilla.sf
new file mode 100644
index 0000000..faf8a50
--- /dev/null
+++ b/META-INF/mozilla.sf
@@ -0,0 +1,4 @@
+Signature-Version: 1.0
+MD5-Digest-Manifest: 3hDMAyzdx4nBtOxphaOYzQ==
+SHA1-Digest-Manifest: EwxId86ms7lNmnobMHLBWinC3c8=
+
diff --git a/chrome.manifest b/chrome.manifest
index 357fb8d..bb0161d 100644
--- a/chrome.manifest
+++ b/chrome.manifest
@@ -9,5 +9,6 @@ locale cookiemonster zh-TW jar:chrome/cookiemonster.jar!/locale/zh-TW/
locale cookiemonster it-IT jar:chrome/cookiemonster.jar!/locale/it-IT/
locale cookiemonster ru-RU jar:chrome/cookiemonster.jar!/locale/ru-RU/
locale cookiemonster nl-NL jar:chrome/cookiemonster.jar!/locale/nl-NL/
+locale cookiemonster zh-TW jar:chrome/cookiemonster.jar!/locale/zh-CN/
skin cookiemonster classic/1.0 jar:chrome/cookiemonster.jar!/skin/
diff --git a/chrome/cookiemonster.jar!/content/cookieInfo.js b/chrome/cookiemonster.jar!/content/cookieInfo.js
index fef190f..767d66e 100644
--- a/chrome/cookiemonster.jar!/content/cookieInfo.js
+++ b/chrome/cookiemonster.jar!/content/cookieInfo.js
@@ -2,7 +2,7 @@
* Retrieve cookie information for the current URL
* @type cookieMonster_CookieInfo
*/
-s1tony.CM.cookieInfo =
+cookieMonsterBys1tony.cookieInfo =
{
choice: null,
_bundle: null,
@@ -10,15 +10,18 @@ s1tony.CM.cookieInfo =
_isEffectiveTLDService: false,
_tempAllowList: null,
_globalOverrideList: null,
+ _nsICookiePermission: Components.interfaces.nsICookiePermission,
+ _nsiPermissionManager: Components.interfaces.nsIPermissionManager,
+ _cm: cookieMonsterBys1tony,
init: function()
{
// Declare instance of cookie permission and
// query an nsICookiePermission interface
this.choice = Components.classes["@mozilla.org/cookie/permission;1"].createInstance();
- this.choice.QueryInterface(Components.interfaces.nsICookiePermission);
+ this.choice.QueryInterface(this._nsICookiePermission);
- this._bundle = document.getElementById("cookie-menu-labels");
+ this._bundle = document.getElementById("cookiemonster-s1tony-menu-labels");
// Check if the method testExactPermission is available
// in the version of the Moz engine being used
@@ -26,7 +29,8 @@ s1tony.CM.cookieInfo =
// in Moz 1.8 (FF2), but is available in Moz 1.9 (FF3)
var accessString = CM_COOKIE_ACCESS_DEFAULT;
var permissionManager = Components.classes["@mozilla.org/permissionmanager;1"]
- .getService(Components.interfaces.nsIPermissionManager);
+ .getService(this._nsiPermissionManager);
+
if (permissionManager.testExactPermission)
{
this._isExactPerm = true;
@@ -42,11 +46,11 @@ s1tony.CM.cookieInfo =
}
// Initialize TempAllow
- s1tony.CM.tempAllow.init();
+ this._cm.tempAllow.init();
// Check if CM_PREFERENCE_TYPE_GLOBAL_OVERRIDE contains
// any URLs and if so, add to _globalOverrideList
- this._globalOverrideList = s1tony.CM.nsPreferences.getStringPrefArray(CM_PREFERENCE_TYPE_GLOBAL_OVERRIDE);
+ this._globalOverrideList = this._cm.nsPreferences.getStringPrefArray(CM_PREFERENCE_TYPE_GLOBAL_OVERRIDE);
},
isExactPermissions: function()
@@ -61,7 +65,7 @@ s1tony.CM.cookieInfo =
setGlobalOverrideList: function()
{
- this._globalOverrideList = s1tony.CM.nsPreferences.getStringPrefArray(CM_PREFERENCE_TYPE_GLOBAL_OVERRIDE);
+ this._globalOverrideList = this._cm.nsPreferences.getStringPrefArray(CM_PREFERENCE_TYPE_GLOBAL_OVERRIDE);
},
// Check the cookie access level for the URI and
@@ -69,7 +73,6 @@ s1tony.CM.cookieInfo =
checkCookieAccess: function(aRequest, aURI)
{
aRequest.QueryInterface(Components.interfaces.nsIChannel);
-
return this.choice.canAccess(aURI , aRequest.originalURI , aRequest);
},
@@ -78,7 +81,6 @@ s1tony.CM.cookieInfo =
checkCookieAccessString: function(aRequest, aURI)
{
var accessString = CM_COOKIE_ACCESS_DEFAULT;
-
aRequest.QueryInterface(Components.interfaces.nsIChannel);
switch (this.choice.canAccess(aURI , aRequest.originalURI , aRequest))
@@ -86,13 +88,13 @@ s1tony.CM.cookieInfo =
case CM_CA_LEVEL_DEFAULT:
accessString = CM_COOKIE_ACCESS_DEFAULT;
break;
- case nsIPermissionManager.ALLOW_ACTION:
+ case this._nsiPermissionManager.ALLOW_ACTION:
accessString = CM_COOKIE_ACCESS_ALLOW;
break;
- case nsIPermissionManager.DENY_ACTION:
+ case this._nsiPermissionManager.DENY_ACTION:
accessString = CM_COOKIE_ACCESS_DENY;
break;
- case nsICookiePermission.ACCESS_SESSION:
+ case this._nsiPermissionManager.ACCESS_SESSION:
accessString = CM_COOKIE_ACCESS_SESSION;
break;
default:
@@ -109,20 +111,20 @@ s1tony.CM.cookieInfo =
{
var accessString = CM_COOKIE_ACCESS_DEFAULT;
var permissionManager = Components.classes["@mozilla.org/permissionmanager;1"]
- .getService(Components.interfaces.nsIPermissionManager);
+ .getService(this._nsiPermissionManager);
switch (permissionManager.testPermission(aURI ,aType))
{
case 0:
accessString = CM_COOKIE_ACCESS_DEFAULT;
break;
- case nsIPermissionManager.ALLOW_ACTION:
+ case permissionManager.ALLOW_ACTION:
accessString = CM_COOKIE_ACCESS_ALLOW;
break;
- case nsIPermissionManager.DENY_ACTION:
+ case permissionManager.DENY_ACTION:
accessString = CM_COOKIE_ACCESS_DENY;
break;
- case nsICookiePermission.ACCESS_SESSION:
+ case this._nsICookiePermission.ACCESS_SESSION:
accessString = CM_COOKIE_ACCESS_SESSION;
break;
default:
@@ -148,7 +150,7 @@ s1tony.CM.cookieInfo =
var tempURIIndex = -1;
var permissionManager = Components.classes["@mozilla.org/permissionmanager;1"]
- .getService(Components.interfaces.nsIPermissionManager);
+ .getService(this._nsiPermissionManager);
// Determine what test permission method to use based
// on the value of _isExactPermission
@@ -160,13 +162,13 @@ s1tony.CM.cookieInfo =
case CM_CA_LEVEL_DEFAULT:
accessStringTop = CM_COOKIE_ACCESS_DEFAULT;
break;
- case nsIPermissionManager.ALLOW_ACTION:
+ case permissionManager.ALLOW_ACTION:
accessStringTop = CM_COOKIE_ACCESS_ALLOW;
break;
- case nsIPermissionManager.DENY_ACTION:
+ case permissionManager.DENY_ACTION:
accessStringTop = CM_COOKIE_ACCESS_DENY;
break;
- case nsICookiePermission.ACCESS_SESSION:
+ case this._nsICookiePermission.ACCESS_SESSION:
accessStringTop = CM_COOKIE_ACCESS_SESSION;
break;
default:
@@ -180,13 +182,13 @@ s1tony.CM.cookieInfo =
case CM_CA_LEVEL_DEFAULT:
accessStringSecond = CM_COOKIE_ACCESS_DEFAULT;
break;
- case nsIPermissionManager.ALLOW_ACTION:
+ case permissionManager.ALLOW_ACTION:
accessStringSecond = CM_COOKIE_ACCESS_ALLOW;
break;
- case nsIPermissionManager.DENY_ACTION:
+ case permissionManager.DENY_ACTION:
accessStringSecond = CM_COOKIE_ACCESS_DENY;
break;
- case nsICookiePermission.ACCESS_SESSION:
+ case this._nsICookiePermission.ACCESS_SESSION:
accessStringSecond = CM_COOKIE_ACCESS_SESSION;
break;
default:
@@ -202,13 +204,13 @@ s1tony.CM.cookieInfo =
case CM_CA_LEVEL_DEFAULT:
accessStringSecond = CM_COOKIE_ACCESS_DEFAULT;
break;
- case nsIPermissionManager.ALLOW_ACTION:
+ case permissionManager.ALLOW_ACTION:
accessStringSecond = CM_COOKIE_ACCESS_ALLOW;
break;
- case nsIPermissionManager.DENY_ACTION:
+ case permissionManager.DENY_ACTION:
accessStringSecond = CM_COOKIE_ACCESS_DENY;
break;
- case nsICookiePermission.ACCESS_SESSION:
+ case this._nsICookiePermission.ACCESS_SESSION:
accessStringSecond = CM_COOKIE_ACCESS_SESSION;
break;
default:
@@ -222,13 +224,13 @@ s1tony.CM.cookieInfo =
case CM_CA_LEVEL_DEFAULT:
accessStringTop = CM_COOKIE_ACCESS_DEFAULT;
break;
- case nsIPermissionManager.ALLOW_ACTION:
+ case permissionManager.ALLOW_ACTION:
accessStringTop = CM_COOKIE_ACCESS_ALLOW;
break;
- case nsIPermissionManager.DENY_ACTION:
+ case permissionManager.DENY_ACTION:
accessStringTop = CM_COOKIE_ACCESS_DENY;
break;
- case nsICookiePermission.ACCESS_SESSION:
+ case this._nsICookiePermission.ACCESS_SESSION:
accessStringTop = CM_COOKIE_ACCESS_SESSION;
break;
default:
@@ -243,13 +245,13 @@ s1tony.CM.cookieInfo =
case CM_CA_LEVEL_DEFAULT:
accessString = CM_COOKIE_ACCESS_DEFAULT;
break;
- case nsIPermissionManager.ALLOW_ACTION:
+ case permissionManager.ALLOW_ACTION:
accessString = CM_COOKIE_ACCESS_ALLOW;
break;
- case nsIPermissionManager.DENY_ACTION:
+ case permissionManager.DENY_ACTION:
accessString = CM_COOKIE_ACCESS_DENY;
break;
- case nsICookiePermission.ACCESS_SESSION:
+ case this._nsICookiePermission.ACCESS_SESSION:
accessString = CM_COOKIE_ACCESS_SESSION;
break;
default:
@@ -260,7 +262,7 @@ s1tony.CM.cookieInfo =
// Lastly check to see if this is a temporary permission
//tempURIIndex = this._tempAllowList.indexOf(aURI.asciiHost);
//if (tempURIIndex > -1)
- if (s1tony.CM.tempAllow.isTempPermission(aURI))
+ if (this._cm.tempAllow.isTempPermission(aURI))
{
accessStringTop = CM_COOKIE_ACCESS_TEMP_ALLOW;
accessString = CM_COOKIE_ACCESS_TEMP_ALLOW;
@@ -268,7 +270,7 @@ s1tony.CM.cookieInfo =
//tempURIIndex = this._tempAllowList.indexOf(secondURI.asciiHost);
//if (tempURIIndex > -1)
- if (s1tony.CM.tempAllow.isTempPermission(secondURI))
+ if (this._cm.tempAllow.isTempPermission(secondURI))
{
accessStringSecond = CM_COOKIE_ACCESS_TEMP_ALLOW;
accessString = CM_COOKIE_ACCESS_TEMP_ALLOW;
@@ -300,13 +302,13 @@ s1tony.CM.cookieInfo =
case CM_CA_LEVEL_DEFAULT:
accessString = CM_COOKIE_ACCESS_DEFAULT;
break;
- case nsIPermissionManager.ALLOW_ACTION:
+ case this._nsiPermissionManager.ALLOW_ACTION:
accessString = CM_COOKIE_ACCESS_ALLOW;
break;
- case nsIPermissionManager.DENY_ACTION:
+ case this._nsiPermissionManager.DENY_ACTION:
accessString = CM_COOKIE_ACCESS_DENY;
break;
- case nsICookiePermission.ACCESS_SESSION:
+ case this._nsICookiePermission.ACCESS_SESSION:
accessString = CM_COOKIE_ACCESS_SESSION;
break;
case CM_CA_LEVEL_TEMP_ALLOW:
@@ -333,13 +335,13 @@ s1tony.CM.cookieInfo =
accessValue = CM_CA_LEVEL_DEFAULT;
break;
case CM_COOKIE_ACCESS_ALLOW:
- accessValue = nsIPermissionManager.ALLOW_ACTION;
+ accessValue = this._nsiPermissionManager.ALLOW_ACTION;
break;
case CM_COOKIE_ACCESS_DENY:
- accessValue = nsIPermissionManager.DENY_ACTION;
+ accessValue = this._nsiPermissionManager.DENY_ACTION;
break;
case CM_COOKIE_ACCESS_SESSION:
- accessValue = nsICookiePermission.ACCESS_SESSION;
+ accessValue = this._nsICookiePermission.ACCESS_SESSION;
break;
case CM_COOKIE_ACCESS_TEMP_ALLOW:
accessValue = CM_CA_LEVEL_TEMP_ALLOW;
@@ -353,12 +355,16 @@ s1tony.CM.cookieInfo =
},
// Set override for hosts cookie access
- setCookieAccess: function(aURI, aAccess, aDomainType)
+ // To process both http and https, set aProcessBoth to true
+ setCookieAccess: function (aURI, aAccess, aDomainType/* , aProcessBoth */)
{
var hostURI = null;
+ var alternateSchemeURI = null;
var accessLevel = null;
var tempHostIndex = -1;
+ var aProcessBoth = false || Boolean(arguments[3]);
+
if (aDomainType == CM_SECOND_LEVEL)
{
hostURI = this.getSecondLevelURI(aURI);
@@ -368,21 +374,39 @@ s1tony.CM.cookieInfo =
hostURI = aURI;
}
+ // If processing both, create a URI for whatever
+ // scheme hostURI is not, either http or https
+ if (aProcessBoth)
+ {
+ alternateSchemeURI = this.getOtherSchemeURI(hostURI);
+ }
+
// Check if temporary access
if (aAccess == CM_CA_LEVEL_TEMP_ALLOW)
{
// Check if URI already has a non-default cookie access
- s1tony.CM.tempAllow.add(hostURI);
- aAccess = nsIPermissionManager.ALLOW_ACTION;
+ this._cm.tempAllow.add(hostURI);
+
+ if (aProcessBoth)
+ {
+ this._cm.tempAllow.add(alternateSchemeURI);
+ }
+
+ aAccess = this._nsiPermissionManager.ALLOW_ACTION;
}
- else if (s1tony.CM.tempAllow.isTempPermission(hostURI))
+ else if (this._cm.tempAllow.isTempPermission(hostURI))
{
- s1tony.CM.tempAllow.remove(hostURI);
+ this._cm.tempAllow.remove(hostURI);
+
+ if (aProcessBoth)
+ {
+ this._cm.tempAllow.remove(alternateSchemeURI);
+ }
// If the updated permission is Deny or Default, where Default
// is Deny, then delete any cookies set for this host
- if ((aAccess == nsIPermissionManager.DENY_ACTION) ||
- ((aAccess == 0) && (s1tony.CM.prefObserver.getCookiePrefString() == this._bundle.getString("rejected"))))
+ if ((aAccess == this._nsiPermissionManager.DENY_ACTION) ||
+ ((aAccess == 0) && (this._cm.prefObserver.getCookiePrefString() == this._bundle.getString("rejected"))))
{
//alert("aAccess = " + aAccess);
// Set aUseBaseDomain to true
@@ -392,16 +416,31 @@ s1tony.CM.cookieInfo =
this.choice.setAccess(hostURI, aAccess);
+ if (aProcessBoth)
+ {
+ this.choice.setAccess(alternateSchemeURI, aAccess);
+ }
+
// If new access is deny and the preference
// deletecookiesondeny is true
// then delete existing cookies for this host
- if ((aAccess == nsIPermissionManager.DENY_ACTION) &&
- s1tony.CM.nsPreferences.getBoolPref("deletecookiesondeny", false))
+ if ((aAccess == this._nsiPermissionManager.DENY_ACTION) &&
+ this._cm.nsPreferences.getBoolPref("deletecookiesondeny", false))
{
- this.deleteHostCookies(hostURI.host, false);
+ this.deleteHostCookies(hostURI.asciiHost, false);
}
},
+ // Create a URI from aURI,
+ // but with the scheme it is not
+ // (i.e. if http, then create one with https)
+ getOtherSchemeURI: function(aURI)
+ {
+ var scheme = aURI.schemeIs("http") ? "https" : "http";
+ var newHostString = this._cm.cookieMonster.getPrePath(aURI.asciiHost, scheme);
+ return this._cm.utils.createURIFromHostName(newHostString, true);
+ },
+
// Convert URI to Second Level Domain
// (i.e. groups.yahoo.com to yahoo.com)
getSecondLevelURI: function(aURI)
@@ -411,9 +450,34 @@ s1tony.CM.cookieInfo =
var newHostString = null;
var newHost = aURI;
- newHostString = this.getSecondLevelHost(hostString);
- newHost = s1tony.CM.utils.createURIFromHostName(newHostString);
-
+ if (this._isEffectiveTLDService)
+ {
+ try
+ {
+ var eTLDService = Components.classes["@mozilla.org/network/effective-tld-service;1"]
+ .getService(Components.interfaces.nsIEffectiveTLDService);
+
+ newHostString = eTLDService.getBaseDomain(aURI);
+ }
+ catch (e)
+ {
+ newHostString = hostString;
+ }
+ }
+ else
+ {
+ newHostString = this.getSecondLevelHost(hostString);
+ }
+
+ newHost = aURI.clone();
+
+ if (newHostString)
+ {
+ newHost.host = newHostString;
+ }
+
+ //newHost = this._cm.utils.createURIFromHostName(newHostString);
+
return newHost;
},
@@ -427,62 +491,62 @@ s1tony.CM.cookieInfo =
var newHostString = null;
// First check if IPv6
- if (aHost.split(":").length > 1)
- {
- // We're probably ipv6
- newHostString = "["+ aHost +"]";
- }
+ if (aHost.split(":").length > 1)
+ {
+ // We're probably ipv6
+ newHostString = "[" + aHost + "]";
+ }
else if (this._isEffectiveTLDService)
{
- // Is the effective-tld-service available
- try
- {
- var eTLDService = Components.classes["@mozilla.org/network/effective-tld-service;1"]
+ // Is the effective-tld-service available
+ try
+ {
+ var eTLDService = Components.classes["@mozilla.org/network/effective-tld-service;1"]
.getService(Components.interfaces.nsIEffectiveTLDService);
-
- newHostString = eTLDService.getBaseDomainFromHost(aHost);
- }
- catch(e)
- {
- newHostString = aHost;
- }
+
+ newHostString = eTLDService.getBaseDomainFromHost(aHost);
+ }
+ catch (e)
+ {
+ newHostString = aHost;
+ }
}
else
{
- // Is this the special case where
- // the URI ends in two characters
- var hostParts = aHost.split(".");
-
- // Do not parse if hostParts.length < 3
- if (hostParts.length >= 3)
- {
- // Normal URI
- if (hostParts[hostParts.length - 1].length > 2)
- {
- newHostString = hostParts[hostParts.length - 2] + "." +
+ // Is this the special case where
+ // the URI ends in two characters
+ var hostParts = aHost.split(".");
+
+ // Do not parse if hostParts.length < 3
+ if (hostParts.length >= 3)
+ {
+ // Normal URI
+ if (hostParts[hostParts.length - 1].length > 2)
+ {
+ newHostString = hostParts[hostParts.length - 2] + "." +
hostParts[hostParts.length - 1];
- }
- // Check to see if special
- // (e.g. www.domain.com.au)/com|net|org|edu/
- else if((checkExp.test(hostParts[hostParts.length - 2]) &&
+ }
+ // Check to see if special
+ // (e.g. www.domain.com.au)/com|net|org|edu/
+ else if ((checkExp.test(hostParts[hostParts.length - 2]) &&
hostParts[hostParts.length - 1].length <= 2) ||
checkSpecialTwo.test(hostParts[hostParts.length - 1]))
- {
-
- newHostString = hostParts[hostParts.length - 3] + "." +
+ {
+
+ newHostString = hostParts[hostParts.length - 3] + "." +
hostParts[hostParts.length - 2] + "." +
hostParts[hostParts.length - 1];
- }
- else
- {
- newHostString = hostParts[hostParts.length - 2] + "." +
+ }
+ else
+ {
+ newHostString = hostParts[hostParts.length - 2] + "." +
hostParts[hostParts.length - 1];
- }
- }
- else
- {
- newHostString = aHost;
- }
+ }
+ }
+ else
+ {
+ newHostString = aHost;
+ }
}
return newHostString;
@@ -508,14 +572,15 @@ s1tony.CM.cookieInfo =
// Add URI asciihost to Override Global cookie permissions list
addOverrideGlobal: function(aHost, aDomainType)
{
- var hostDomain = aHost;
+ var hostDomain = aHost;
+
if (aDomainType == CM_SECOND_LEVEL)
{
hostDomain = this.getSecondLevelHost(aHost);
}
this._globalOverrideList.push(hostDomain);
- s1tony.CM.nsPreferences.setAppendToStringPref(CM_PREFERENCE_TYPE_GLOBAL_OVERRIDE, hostDomain);
+ this._cm.nsPreferences.setAppendToStringPref(CM_PREFERENCE_TYPE_GLOBAL_OVERRIDE, hostDomain);
},
// Remove URI asciihost from Override Global cookie permissions list
@@ -529,11 +594,12 @@ s1tony.CM.cookieInfo =
hostDomain = this.getSecondLevelHost(aHost);
}
- overrideHostIndex = this._globalOverrideList.indexOf(hostDomain);
+ overrideHostIndex = this._globalOverrideList.indexOf(hostDomain);
+
if (overrideHostIndex > -1)
{
this._globalOverrideList.splice(overrideHostIndex, 1);
- s1tony.CM.nsPreferences.setStringPrefArray(CM_PREFERENCE_TYPE_GLOBAL_OVERRIDE, this._globalOverrideList);
+ this._cm.nsPreferences.setStringPrefArray(CM_PREFERENCE_TYPE_GLOBAL_OVERRIDE, this._globalOverrideList);
}
},
@@ -541,10 +607,10 @@ s1tony.CM.cookieInfo =
removeAllOverrideGlobal: function()
{
this._globalOverrideList = new Array();
- s1tony.CM.nsPreferences.clearUserPref(CM_PREFERENCE_TYPE_GLOBAL_OVERRIDE);
+ this._cm.nsPreferences.clearUserPref(CM_PREFERENCE_TYPE_GLOBAL_OVERRIDE);
// Reset any global override permissions in place
- s1tony.CM.cookieMonster.extResetGlobalCookiePref();
+ this._cm.cookieMonster.extResetGlobalCookiePref();
},
// Delete cookies from host
@@ -562,6 +628,7 @@ s1tony.CM.cookieInfo =
}
var iter = cookieManager.enumerator;
+
while (iter.hasMoreElements())
{
var cookie = iter.getNext();
diff --git a/chrome/cookiemonster.jar!/content/cookieMonster.js b/chrome/cookiemonster.jar!/content/cookieMonster.js
index adf1ece..2af0e01 100644
--- a/chrome/cookiemonster.jar!/content/cookieMonster.js
+++ b/chrome/cookiemonster.jar!/content/cookieMonster.js
@@ -1,7 +1,7 @@
// cookieMonster.js
// Tony Schilling
// Created: 01/20/2007
-// Last Updated: 03/16/2014
+// Last Updated: 11/16/2015
// Use XPCOM to detect browser tab changes and
// interface to the cookie manager and the
@@ -10,14 +10,9 @@
// the cookie status for the current URI
// Define "namespace" for Cookie Monster objects
-if(!s1tony) var s1tony = {};
-if(!s1tony.CM) s1tony.CM = {};
-//let s1tony.CM = {}
+if (!cookieMonsterBys1tony) var cookieMonsterBys1tony = {};
// Constants
-const nsIPermissionManager = Components.interfaces.nsIPermissionManager;
-const nsICookiePermission = Components.interfaces.nsICookiePermission;
-
const CM_ICON_DEFAULT_ORIGINAL = "chrome://cookiemonster/skin/face-monkey-small.png";
const CM_ICON_DEFAULT = "chrome://cookiemonster/skin/cookie-monster-logo.png";
const CM_ICON_TEMP_ALLOW = "chrome://cookiemonster/skin/face-angel-temp.png";
@@ -65,7 +60,7 @@ const CM_GLOBAL_COOKIE_PERM_REJECTED = "Rejected";
// with documents loading in the browser and with tab switching events.
// Progress listeners implement the nsIWebProgressListener interface.
// Create an object which implements nsIWebProgressListener
-s1tony.CM.urlBarListener =
+cookieMonsterBys1tony.urlBarListener =
{
QueryInterface: function(aIID)
{
@@ -78,13 +73,13 @@ s1tony.CM.urlBarListener =
onLocationChange: function(aProgress, aRequest, aURI)
{
- if ((aURI != null) && s1tony.CM.cookieMonster.extGetIsAllowGlobalOverride())
+ if ((aURI != null) && cookieMonsterBys1tony.cookieMonster.extGetIsAllowGlobalOverride())
{
- s1tony.CM.cookieMonster.extCheckGlobalCookiePref(aURI);
+ cookieMonsterBys1tony.cookieMonster.extCheckGlobalCookiePref(aURI);
}
if (!aProgress.DOMWindow.frameElement)
{
- s1tony.CM.cookieMonster.processNewURL(aProgress, aRequest, aURI);
+ cookieMonsterBys1tony.cookieMonster.processNewURL(aProgress, aRequest, aURI);
}
return 0;
},
@@ -136,7 +131,7 @@ s1tony.CM.urlBarListener =
// with documents loading in the browser and with tab switching events.
// Progress listeners implement the nsIWebProgressListener interface.
// Create an object which implements nsIWebProgressListener
-s1tony.CM.tabProgressListener =
+cookieMonsterBys1tony.tabProgressListener =
{
QueryInterface: function(aIID)
{
@@ -161,13 +156,13 @@ s1tony.CM.tabProgressListener =
{
// This fires when the load event of type network is initiated
//alert("Start State Flags: " + aStateFlags + " Request Name: " + aRequest.name);
- s1tony.CM.cookieRequest.clearBrowser(aBrowser);
+ cookieMonsterBys1tony.cookieRequest.clearBrowser(aBrowser);
}
if (aStateFlags & nsIWebProgressListener.STATE_STOP && aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK)
{
// Process any cookie requests made by browser during load
- s1tony.CM.cookieRequest.processCookieRequests(aBrowser);
+ cookieMonsterBys1tony.cookieRequest.processCookieRequests(aBrowser);
}
return 0;
@@ -178,25 +173,26 @@ s1tony.CM.tabProgressListener =
onLinkIconAvailable: function() {return 0;}
};
-s1tony.CM.customizableUIListener =
+cookieMonsterBys1tony.customizableUIListener =
{
onWidgetAfterDOMChange: function(aNode, aNextNode, aContainer, aWasRemoval)
{
- if (aNode.id === "cookiemonster-status")
+ if (aNode.id === "cookiemonster-status")
{
- s1tony.CM.cookieMonsterButton.checkButtonClick();
+ cookieMonsterBys1tony.cookieMonsterButton.checkButtonClick();
//console.log("onWidgetAfterDOMChange - node: " + aNode.id + ", aContainer: " + aContainer.id);
}
}
};
-s1tony.CM.cookieMonsterButton =
+cookieMonsterBys1tony.cookieMonsterButton =
{
_elementId: null,
_element: null,
_cmReference: null,
_currentIcon: null,
_currentPopupId: null,
+ _cm: cookieMonsterBys1tony,
/**
* Initialize this object
@@ -210,16 +206,16 @@ s1tony.CM.cookieMonsterButton =
if (document.getElementById("PanelUI-menu-button"))
{
var cmButtonLocation = CustomizableUI.getPlacementOfWidget(this._elementId);
- CustomizableUI.addListener(s1tony.CM.customizableUIListener);
+ CustomizableUI.addListener(this._cm.customizableUIListener);
console.log("Firefox running Australis");
if (cmButtonLocation)
{
this._element = document.getElementById(this._elementId);
}
- else if (!s1tony.CM.nsPreferences.getBoolPref("firstRunDone", false))
+ else if (!this._cm.nsPreferences.getBoolPref("firstRunDone", false))
{
- s1tony.CM.nsPreferences.setBoolPref("firstRunDone", true);
+ this._cm.nsPreferences.setBoolPref("firstRunDone", true);
// Since first run, place on nav-bar bar
CustomizableUI.addWidgetToArea(this._elementId, "nav-bar");
@@ -232,9 +228,9 @@ s1tony.CM.cookieMonsterButton =
this._element = document.getElementById(this._elementId);
- if (!this._element && !s1tony.CM.nsPreferences.getBoolPref("firstRunDone", false))
+ if (!this._element && !this._cm.nsPreferences.getBoolPref("firstRunDone", false))
{
- s1tony.CM.nsPreferences.setBoolPref("firstRunDone", true);
+ this._cm.nsPreferences.setBoolPref("firstRunDone", true);
// Since first run, place on nav-bar bar
installButton("nav-bar", this._elementId);
@@ -247,7 +243,7 @@ s1tony.CM.cookieMonsterButton =
if (this._element)
{
this._element.removeAttribute("tooltiptext");
- this._element.setAttribute("tooltip", "cookie-results");
+ this._element.setAttribute("tooltip", "cookiemonster-s1tony-results");
this._element.addEventListener('command',
function(event) {cmReference.extThirdPartyMenuLoadHandler(event)}, false);
@@ -304,7 +300,7 @@ s1tony.CM.cookieMonsterButton =
if (this._element && this._element.hasAttribute("tooltiptext"))
{
this._element.removeAttribute("tooltiptext");
- this._element.setAttribute("tooltip", "cookie-results");
+ this._element.setAttribute("tooltip", "cookiemonster-s1tony-results");
var that = this;
this._element.addEventListener('command',
@@ -370,7 +366,7 @@ s1tony.CM.cookieMonsterButton =
}
};
-s1tony.CM.cookieMonster =
+cookieMonsterBys1tony.cookieMonster =
{
_oldURL: null,
_oldAccess: null,
@@ -384,6 +380,8 @@ s1tony.CM.cookieMonster =
_secondLevel: false,
_secondLevelId: null,
_secondLevelMenuOption: null,
+ _bothSchemesId: null,
+ _bothSchemesMenuOption: null,
_thirdPartyMenuOption: null,
_thirdPartyId: null,
_globalOverrideId: null,
@@ -397,16 +395,18 @@ s1tony.CM.cookieMonster =
_iconList: null,
_flagMenuEvent: false,
_flagGlobalCookieEvent: false,
+ _processHttpAndHttps: false,
//_statusImageAttribute: "src",
+ _cm: cookieMonsterBys1tony,
init: function()
{
var copyURI = null;
var that = this;
-
+
// Listen for webpage loads
- gBrowser.addProgressListener(s1tony.CM.urlBarListener);
- gBrowser.addTabsProgressListener(s1tony.CM.tabProgressListener);
+ gBrowser.addProgressListener(this._cm.urlBarListener);
+ gBrowser.addTabsProgressListener(this._cm.tabProgressListener);
gBrowser.tabContainer.addEventListener("TabClose", this.tabUnload, false);
copyURI = Components.classes["@mozilla.org/network/io-service;1"].
@@ -414,35 +414,36 @@ s1tony.CM.cookieMonster =
this._oldURL = copyURI.newURI("about:blank", null, null);
this._oldAccess = new Array(CM_COOKIE_ACCESS_DEFAULT, CM_COOKIE_ACCESS_DEFAULT, CM_COOKIE_ACCESS_DEFAULT);
- // Add extension name to s1tony.CM.nsPreferences
- s1tony.CM.nsPreferences.mBranch = "cookiemonster";
+ // Add extension name to this._cm.nsPreferences
+ this._cm.nsPreferences.mBranch = "cookiemonster";
// Initialize CookieInfo, Utils, ShowCookieMenu, ShowCookieExceptions and CookieMonsterButton
- s1tony.CM.cookieInfo.init();
- s1tony.CM.utils.init();
- s1tony.CM.showCookiesMenu.init();
- s1tony.CM.showCookieExceptions.init();
- s1tony.CM.cookieMonsterButton.init(this, "cookiemonster-status");
+ this._cm.cookieInfo.init();
+ this._cm.utils.init();
+ this._cm.showCookiesMenu.init();
+ this._cm.showCookieExceptions.init();
+ this._cm.cookieMonsterButton.init(this, "cookiemonster-status");
// Register preferences and permission observers
- s1tony.CM.prefObserver.register();
- s1tony.CM.observerService.register();
+ this._cm.prefObserver.register();
+ this._cm.observerService.register();
// Retrieve users's default cookie permissions
- this._userDefault = s1tony.CM.prefObserver.getCookiePrefString();
- this._currentGlobalPreference = s1tony.CM.prefObserver.getCookiePrefArray();
+ this._userDefault = this._cm.prefObserver.getCookiePrefString();
+ this._currentGlobalPreference = this._cm.prefObserver.getCookiePrefArray();
// Create a reference to all the menu elements
- this._menuBundle = document.getElementById("cookie-menu-labels");
- this._cookieMonsterMenuId = "cookiemonster-menu";
- this._secondLevelId = "option-second-level";
- this._cookieMonsterSubMenuId = "cookie-access-alternate";
- this._globalOverrideId = "show-global-override";
- this._thirdPartyId = "cookie-thirdparty-permissions";
+ this._menuBundle = document.getElementById("cookiemonster-s1tony-menu-labels");
+ this._cookieMonsterMenuId = "cookiemonster-s1tony-menu";
+ this._secondLevelId = "cookiemonster-s1tony-option-second-level";
+ this._bothSchemesId = "cookiemonster-s1tony-option-both-schemes";
+ this._cookieMonsterSubMenuId = "cookiemonster-s1tony-access-alternate";
+ this._globalOverrideId = "cookiemonster-s1tony-show-global-override";
+ this._thirdPartyId = "cookiemonster-s1tony-thirdparty-permissions";
// Retrieve the current value for secondlevelurl and
// initialize secondlevelurl in StatusbarMenu
- this._secondLevel = s1tony.CM.nsPreferences.getBoolPref("secondlevelurl", false);
+ this._secondLevel = this._cm.nsPreferences.getBoolPref("secondlevelurl", false);
this._cookieMonsterMenu = document.getElementById(this._cookieMonsterMenuId);
this._cookieMonsterMenu.addEventListener('command', function(event) {that.extMenuCommandHandler(event)},
true);
@@ -458,20 +459,26 @@ s1tony.CM.cookieMonster =
}
this._thirdPartyMenuOption = document.getElementById(this._thirdPartyId);
-
+
// Retrieve the current value for enableglobalcookieoverride
- this._allowGlobalOverride = s1tony.CM.nsPreferences.getBoolPref("enableglobalcookieoverride", false);
+ this._allowGlobalOverride = this._cm.nsPreferences.getBoolPref("enableglobalcookieoverride", false);
this._globalOverrideMenuOption = document.getElementById(this._globalOverrideId);
this._globalOverrideMenuOption.setAttribute("disabled", !this._allowGlobalOverride);
// Retrieve the current value for reloadOnPermissionChange
- this._reloadOnPermissionChange = s1tony.CM.nsPreferences.getBoolPref("reloadonpermissionchange", false);
+ this._reloadOnPermissionChange = this._cm.nsPreferences.getBoolPref("reloadonpermissionchange", false);
+ // Retrieve the current value for bothhttpandhttps and
+ // initialize in StatusbarMenu
+ this._processHttpAndHttps = this._cm.nsPreferences.getBoolPref("bothhttpandhttps", false);
+ this._bothSchemesMenuOption = document.getElementById(this._bothSchemesId);
+ this._bothSchemesMenuOption.setAttribute("checked", this._processHttpAndHttps);
+
// Load icons into _iconList (actually an object)
this._iconList = new Object();
// Determine what default icon to use
- if (!s1tony.CM.nsPreferences.getBoolPref("originaldefaulticon", false))
+ if (!this._cm.nsPreferences.getBoolPref("originaldefaulticon", false))
{
this._iconList[CM_COOKIE_ACCESS_DEFAULT] = CM_ICON_DEFAULT;
}
@@ -490,20 +497,22 @@ s1tony.CM.cookieMonster =
uninit: function()
{
- gBrowser.removeProgressListener(s1tony.CM.urlBarListener);
- gBrowser.removeTabsProgressListener(s1tony.CM.tabProgressListener);
+ gBrowser.removeProgressListener(this._cm.urlBarListener);
+ gBrowser.removeTabsProgressListener(this._cm.tabProgressListener);
gBrowser.tabContainer.removeEventListener("TabClose", this.tabUnload, false);
// Unregister all observers
- s1tony.CM.prefObserver.unregister();
- s1tony.CM.observerService.unregister();
+ this._cm.prefObserver.unregister();
+ this._cm.observerService.unregister();
},
+ // This method is called from an event handler,
+ // so the this variable is not cookieMonsterBys1tony.cookieMonster
tabUnload: function(evt)
{
var browser = gBrowser.getBrowserForTab(evt.target);
- //s1tony.CM.cookieRequest.removeHost(browser.currentURI.asciiHost);
- s1tony.CM.cookieRequest.removeBrowser(browser);
+ //cookieMonsterBys1tony.cookieRequest.removeHost(browser.currentURI.asciiHost);
+ cookieMonsterBys1tony.cookieRequest.removeBrowser(browser);
},
processNewURL: function(aProgress, aRequest, aURI)
@@ -519,7 +528,7 @@ s1tony.CM.cookieMonster =
{
// Update oldURL and oldAccess
this._oldURL = aURI.clone();
- this._oldAccess = s1tony.CM.cookieInfo.checkPermissionArray(aURI, CM_PERMISSION_TYPE_COOKIE);
+ this._oldAccess = this._cm.cookieInfo.checkPermissionArray(aURI, CM_PERMISSION_TYPE_COOKIE);
// if host is empty, "disable" statusbar menu \s\w*
if (aURI.asciiHost.replace(/^\s*$/, "") == "")
@@ -529,7 +538,7 @@ s1tony.CM.cookieMonster =
}
// Update statusbar menu
- this.updateStatusbarMenu(this._oldURL.asciiHost, this._oldAccess);
+ this.updateStatusbarMenu(this._oldURL, this._oldAccess);
}
else
{
@@ -539,28 +548,42 @@ s1tony.CM.cookieMonster =
},
// Update the text and menuitems in the statusbar popup menu
- updateStatusbarMenu: function(aHost, aAccess)
+ updateStatusbarMenu: function(aURI, aAccess)
{
- //alert("Host: " + aHost + " Access: " + aAccess[CM_TOP_LEVEL]);
var menuNodes = null;
- var hostDisplay = aHost;
- var hostDomain = s1tony.CM.cookieInfo.getSecondLevelHost(aHost);
+
+ var host;
+ var hostDomain = this._cm.cookieInfo.getSecondLevelHost(aURI.asciiHost);
+ var viewCookiesDomain = hostDomain;
+
+ // Determine if the scheme should also be displayed
+ if (this._processHttpAndHttps)
+ {
+ host = aURI.asciiHost;
+ }
+ else
+ {
+ host = aURI.prePath;
+ hostDomain = this.getPrePath(hostDomain, aURI.scheme);
+ }
+
+ var hostDisplayOld = host;
var hostAccess = aAccess[CM_URL_STANDARD_LEVEL];
var checkOldAccess = aAccess[CM_TOP_LEVEL];
- var permissionsDisplayTop = document.getElementById("permissions-top");
- var permissionsDisplaySecond = document.getElementById("permissions-second");
- var permissionsDisplayResult = document.getElementById("permissions-result");
- var cookieTooltipSite = document.getElementById("cookie-group-site");
- var cookieTooltipDomain = document.getElementById("cookie-group-domain");
- var cookieTooltipResult = document.getElementById("cookie-group-result");
- var showCookiesCurrentDomain = document.getElementById("show-cookies-site");
- var deleteCookiesCurrentDomain = document.getElementById("delete-cookies-site");
+ var permissionsDisplayTop = document.getElementById("cookiemonster-s1tony-permissions-top");
+ var permissionsDisplaySecond = document.getElementById("cookiemonster-s1tony-permissions-second");
+ var permissionsDisplayResult = document.getElementById("cookiemonster-s1tony-permissions-result");
+ var cookieTooltipSite = document.getElementById("cookiemonster-s1tony-group-site");
+ var cookieTooltipDomain = document.getElementById("cookiemonster-s1tony-group-domain");
+ var cookieTooltipResult = document.getElementById("cookiemonster-s1tony-group-result");
+ var showCookiesCurrentDomain = document.getElementById("cookiemonster-s1tony-show-cookies-site");
+ var deleteCookiesCurrentDomain = document.getElementById("cookiemonster-s1tony-delete-cookies-site");
// If the user has selected 2nd Level domains,
// then display as such
if (this._secondLevel)
{
- hostDisplay = hostDomain;
+ hostDisplayOld = hostDomain;
checkOldAccess = aAccess[CM_SECOND_LEVEL];
}
@@ -570,9 +593,11 @@ s1tony.CM.cookieMonster =
if (this._cookieMonsterMenuArray[x].hasChildNodes())
{
menuNodes = this._cookieMonsterMenuArray[x].childNodes;
+
for (var i = 0; i < menuNodes.length; i++)
{
- var menu = menuNodes [i];
+ var menu = menuNodes[i];
+
if (menu.nodeName != "menuitem")
{
continue;
@@ -594,7 +619,8 @@ s1tony.CM.cookieMonster =
{
menu.setAttribute("name","cookie-top");
}
- menu.setAttribute("label", this._menuBundle.getString(idParsed) + " " + aHost);
+
+ menu.setAttribute("label", this._menuBundle.getString(idParsed) + " " + host);
}
else if (idDomain == "second")
{
@@ -606,6 +632,7 @@ s1tony.CM.cookieMonster =
{
menu.setAttribute("name","cookie-two");
}
+
menu.setAttribute("label", this._menuBundle.getString(idParsed) + " " + hostDomain);
}
else if (idDomain == "default")
@@ -618,6 +645,7 @@ s1tony.CM.cookieMonster =
{
menu.setAttribute("name","cookie-default");
}
+
menu.setAttribute("label", this._menuBundle.getString(idParsed) + " (" + this._userDefault + ")");
}
else if (idDomain == "access")
@@ -631,7 +659,8 @@ s1tony.CM.cookieMonster =
{
menu.setAttribute("name","cookie-access");
}
- menu.setAttribute("label", this._menuBundle.getString(idParsed) + " " + hostDisplay);
+
+ menu.setAttribute("label", this._menuBundle.getString(idParsed) + " " + hostDisplayOld);
// For default, display users cookie permission preferences
if (idParsed == CM_COOKIE_ACCESS_DEFAULT.toLowerCase())
@@ -645,18 +674,18 @@ s1tony.CM.cookieMonster =
// Add domain name to show cookies for current site and delete cookies
// for current site
- showCookiesCurrentDomain.setAttribute("label", this._menuBundle.getString("showcurrentcookies") + " " + hostDomain);
- showCookiesCurrentDomain.setAttribute("name", hostDomain);
- deleteCookiesCurrentDomain.setAttribute("label", this._menuBundle.getString("deletecurrentcookies") + " " + hostDomain);
- deleteCookiesCurrentDomain.setAttribute("name", hostDomain);
+ showCookiesCurrentDomain.setAttribute("label", this._menuBundle.getString("showcurrentcookies") + " " + viewCookiesDomain);
+ showCookiesCurrentDomain.setAttribute("name", viewCookiesDomain);
+ deleteCookiesCurrentDomain.setAttribute("label", this._menuBundle.getString("deletecurrentcookies") + " " + viewCookiesDomain);
+ deleteCookiesCurrentDomain.setAttribute("name", viewCookiesDomain);
// Update permissions Synopsis and Enhanced Tooltip
permissionsDisplayTop.setAttribute("label", this._menuBundle.getString("sitepermissions") +
- " (" + aHost + "): " + this._menuBundle.getString(aAccess[CM_TOP_LEVEL]));
+ " (" + host + "): " + this._menuBundle.getString(aAccess[CM_TOP_LEVEL]));
permissionsDisplaySecond.setAttribute("label", this._menuBundle.getString("domainpermissions") +
" (" + hostDomain + "): " + this._menuBundle.getString(aAccess[CM_SECOND_LEVEL]));
permissionsDisplayResult.setAttribute("label", this._menuBundle.getString("permissionsresultfor") +
- " " + aHost + ": " + this._menuBundle.getString(hostAccess));
+ " " + host + ": " + this._menuBundle.getString(hostAccess));
permissionsDisplayTop.setAttribute("image", this.getIcon(aAccess[CM_TOP_LEVEL])); //this._iconList[aAccess[CM_TOP_LEVEL]]
permissionsDisplaySecond.setAttribute("image", this.getIcon(aAccess[CM_SECOND_LEVEL]));
@@ -673,13 +702,13 @@ s1tony.CM.cookieMonster =
cookieTooltipDomain.firstChild.setAttribute("image", this.getIcon(aAccess[CM_SECOND_LEVEL]));
cookieTooltipResult.firstChild.setAttribute("image", this.getIcon(hostAccess));
- cookieTooltipSite.lastChild.setAttribute("value", aHost);
+ cookieTooltipSite.lastChild.setAttribute("value", host);
cookieTooltipDomain.lastChild.setAttribute("value", hostDomain);
- cookieTooltipResult.lastChild.setAttribute("value", aHost);
+ cookieTooltipResult.lastChild.setAttribute("value", host);
// Set the icon for the status bar menu
//this._cookieMonsterButton.setAttribute(this._statusImageAttribute, this.getIcon(hostAccess));
- s1tony.CM.cookieMonsterButton.setIcon(this.getIcon(hostAccess));
+ this._cm.cookieMonsterButton.setIcon(this.getIcon(hostAccess));
},
// Swap the menu items in the submenu
@@ -704,13 +733,13 @@ s1tony.CM.cookieMonster =
{
var that = this;
var cookieMenuItems = new Array(
- new Array(document.getElementById("cookie-access-top-temp"), document.getElementById("cookie-access-second-temp")),
- new Array(document.getElementById("cookie-access-top-allow"), document.getElementById("cookie-access-second-allow")),
- new Array(document.getElementById("cookie-access-top-deny"), document.getElementById("cookie-access-second-deny")),
- new Array(document.getElementById("cookie-access-top-session"), document.getElementById("cookie-access-second-session"))
+ new Array(document.getElementById("cookiemonster-s1tony-access-top-temp"), document.getElementById("cookiemonster-s1tony-access-second-temp")),
+ new Array(document.getElementById("cookiemonster-s1tony-access-top-allow"), document.getElementById("cookiemonster-s1tony-access-second-allow")),
+ new Array(document.getElementById("cookiemonster-s1tony-access-top-deny"), document.getElementById("cookiemonster-s1tony-access-second-deny")),
+ new Array(document.getElementById("cookiemonster-s1tony-access-top-session"), document.getElementById("cookiemonster-s1tony-access-second-session"))
);
- var cookieMenuSeparator = document.getElementById("temp-after-this");
- var altAccessMenu = document.getElementById("cookie-access-menu");
+ var cookieMenuSeparator = document.getElementById("cookiemonster-s1tony-temp-after-this");
+ var altAccessMenu = document.getElementById("cookiemonster-s1tony-access-menu");
var accessMenuLabel = this._menuBundle.getString("sitemenulabel");
var swapCookieMenuItems;
@@ -790,7 +819,7 @@ s1tony.CM.cookieMonster =
if (aThirdPartyCookieList == null || aThirdPartyCookieList.length == 0)
{
defaultMenuItem = document.createElement("menuitem");
- defaultMenuItem.id = "cookie-thirdparty-default-none";
+ defaultMenuItem.id = "cookiemonster-s1tony-thirdparty-default-none";
defaultMenuItem.setAttribute("label", this._menuBundle.getString("thirdpartynone"));
defaultMenuItem.setAttribute("class", "menuitem-iconic");
defaultMenuItem.setAttribute("disabled", "true");
@@ -803,15 +832,16 @@ s1tony.CM.cookieMonster =
{
// First construct the menu
var tempMenuItem = document.createElement("menu");
- var hostAccess = s1tony.CM.cookieInfo.getPermissionString(tempCookieItem.accessValue);
+ var hostAccess = this._cm.cookieInfo.getPermissionString(tempCookieItem.accessValue);
+ var host = this._processHttpAndHttps ? tempCookieItem.uri.asciiHost : tempCookieItem.uri.prePath;
- tempMenuItem.id = "cookie-thirdparty-" + index;
+ tempMenuItem.id = "cookiemonster-s1tony-thirdparty-" + index;
tempMenuItem.setAttribute("label", this._menuBundle.getString("permissionsresultfor") +
- " " + tempCookieItem.host + ": " + this._menuBundle.getString(hostAccess));
+ " " + host + ": " + this._menuBundle.getString(hostAccess));
tempMenuItem.setAttribute("image", this.getIcon(hostAccess));
tempMenuItem.setAttribute("class", "menu-iconic");
tempMenuItem.addEventListener('command',
- function(event) {that.extThirdPartyMenuSiteHandler(event, tempCookieItem.host)}, false);
+ function(event) {that.extThirdPartyMenuSiteHandler(event, tempCookieItem.uri)}, false);
menu.appendChild(tempMenuItem);
// Then create a popup containing all of the cookie access choices
@@ -826,13 +856,13 @@ s1tony.CM.cookieMonster =
tempMenuPopup.appendChild(this._createThirdPartyMenuItem("session", 8, tempCookieItem));
// Add host to third party host array
- thirdPartyHosts.push(tempCookieItem.host);
+ thirdPartyHosts.push(tempCookieItem.uri);
}, this
);
menu.appendChild(document.createElement("menuseparator"));
tempAllowAllMenuItem = document.createElement("menuitem");
- tempAllowAllMenuItem.id = "cookie-thirdparty-tempallow-all";
+ tempAllowAllMenuItem.id = "cookiemonster-s1tony-thirdparty-tempallow-all";
tempAllowAllMenuItem.setAttribute("label", this._menuBundle.getString("thirdpartytempallowall"));
tempAllowAllMenuItem.setAttribute("class", "menuitem-iconic");
tempAllowAllMenuItem.addEventListener('command',
@@ -840,7 +870,7 @@ s1tony.CM.cookieMonster =
menu.appendChild(tempAllowAllMenuItem);
tempRevokeAllMenuItem = document.createElement("menuitem");
- tempRevokeAllMenuItem.id = "cookie-thirdparty-tempallow-revoke";
+ tempRevokeAllMenuItem.id = "cookiemonster-s1tony-thirdparty-tempallow-revoke";
tempRevokeAllMenuItem.setAttribute("label", this._menuBundle.getString("thirdpartytemprevokeall"));
tempRevokeAllMenuItem.setAttribute("class", "menuitem-iconic");
tempRevokeAllMenuItem.addEventListener('command',
@@ -858,12 +888,13 @@ s1tony.CM.cookieMonster =
*/
_createThirdPartyMenuItem: function(aType, aMenuItemValue, aCookieItem)
{
- var cookieMenuItem = document.createElement("menuitem");
+ var cookieMenuItem = document.createElement("menuitem");
+ var host = this._processHttpAndHttps ? aCookieItem.uri.asciiHost : aCookieItem.uri.prePath;
- cookieMenuItem.id = "cookie-access-third-" + aType;
+ cookieMenuItem.id = "cookiemonster-s1tony-access-third-" + aType;
cookieMenuItem.value = aMenuItemValue.toString();
cookieMenuItem.setAttribute("name", "cookie-three");
- cookieMenuItem.setAttribute("label", this._menuBundle.getString(aType) + " " + aCookieItem.host);
+ cookieMenuItem.setAttribute("label", this._menuBundle.getString(aType) + " " + host);
cookieMenuItem.setAttribute("class", "menuitem-iconic");
// Update label if default
@@ -895,7 +926,7 @@ s1tony.CM.cookieMonster =
if (aEnable)
{
//this._cookieMonsterButton.setAttribute("popup", this._cookieMonsterMenuId);
- s1tony.CM.cookieMonsterButton.setPopup(this._cookieMonsterMenuId);
+ this._cm.cookieMonsterButton.setPopup(this._cookieMonsterMenuId);
}
else
{
@@ -903,8 +934,8 @@ s1tony.CM.cookieMonster =
// set the icon for the status bar menu to default
// this._cookieMonsterButton.setAttribute("popup", "");
// this._cookieMonsterButton.setAttribute(this._statusImageAttribute, this._iconList[CM_COOKIE_ACCESS_DEFAULT]);
- s1tony.CM.cookieMonsterButton.setPopup("");
- s1tony.CM.cookieMonsterButton.setIcon(this._iconList[CM_COOKIE_ACCESS_DEFAULT]);
+ this._cm.cookieMonsterButton.setPopup("");
+ this._cm.cookieMonsterButton.setIcon(this._iconList[CM_COOKIE_ACCESS_DEFAULT]);
}
// Set member variable to track status of the menu
@@ -935,6 +966,18 @@ s1tony.CM.cookieMonster =
return retValue;
},
+ /**
+ * Create string with scheme and host name,
+ * similar to the prePath property of nsURI
+ * @param {String} aHost
+ * @param {String} aScheme
+ * @return {String} prePath (e.g. http://mozilla.org)
+ */
+ getPrePath: function(aHost, aScheme)
+ {
+ return aScheme + "://" + aHost;
+ },
+
// External access to current URI
extGetCurrentURI: function()
{
@@ -949,7 +992,7 @@ s1tony.CM.cookieMonster =
if (this._secondLevel)
{
- currentHost = s1tony.CM.cookieInfo.getSecondLevelHost(currentHost);
+ currentHost = this._cm.cookieInfo.getSecondLevelHost(currentHost);
}
return currentHost;
@@ -1004,15 +1047,15 @@ s1tony.CM.cookieMonster =
aURI = arguments[1];
}
- var accessLevel = s1tony.CM.cookieInfo.checkPermissionArray(aURI, CM_PERMISSION_TYPE_COOKIE);
- return s1tony.CM.cookieInfo.getPermissionValue(accessLevel[domainType]);
+ var accessLevel = this._cm.cookieInfo.checkPermissionArray(aURI, CM_PERMISSION_TYPE_COOKIE);
+ return this._cm.cookieInfo.getPermissionValue(accessLevel[domainType]);
},
extSetCookieAccess: function(aAccess, domainType)
{
//alert("Setting Cookie Status for " + this._oldURL.asciiHost);
- s1tony.CM.cookieInfo.setCookieAccess(this._oldURL, aAccess, domainType);
- this._oldAccess = s1tony.CM.cookieInfo.checkPermissionArray(this._oldURL, CM_PERMISSION_TYPE_COOKIE);
+ this._cm.cookieInfo.setCookieAccess(this._oldURL, aAccess, domainType, this._processHttpAndHttps);
+ this._oldAccess = this._cm.cookieInfo.checkPermissionArray(this._oldURL, CM_PERMISSION_TYPE_COOKIE);
},
extResetTempCookies: function(/*, aQuit */)
@@ -1022,11 +1065,11 @@ s1tony.CM.cookieMonster =
// Set menu event flag so we don't double trigger a permissions update
this._flagMenuEvent = true;
- s1tony.CM.tempAllow.resetTempCookies();
+ this._cm.tempAllow.resetTempCookies();
if (!aQuit)
{
- this._oldAccess = s1tony.CM.cookieInfo.checkPermissionArray(this._oldURL, CM_PERMISSION_TYPE_COOKIE);
+ this._oldAccess = this._cm.cookieInfo.checkPermissionArray(this._oldURL, CM_PERMISSION_TYPE_COOKIE);
// Only reload page if reloadOnPermissionChange preference == true
if (this._reloadOnPermissionChange)
@@ -1034,7 +1077,7 @@ s1tony.CM.cookieMonster =
gBrowser.reload(gBrowser.webNavigation.LOAD_FLAGS_BYPASS_CACHE);
}
- this.updateStatusbarMenu(this._oldURL.asciiHost, this._oldAccess);
+ this.updateStatusbarMenu(this._oldURL, this._oldAccess);
}
// Reset menu event flag
@@ -1058,7 +1101,7 @@ s1tony.CM.cookieMonster =
// domainType = CM_SECOND_LEVEL;
// }
- overrideGlobal = s1tony.CM.cookieInfo.checkOverrideGlobal(aURI);
+ overrideGlobal = this._cm.cookieInfo.checkOverrideGlobal(aURI);
// For now, set _usingGlobalOverride if either CM_TOP_LEVEL or
// CM_SECOND_LEVEL are set, as the Global Override setting
@@ -1080,11 +1123,11 @@ s1tony.CM.cookieMonster =
if (currentSiteAccess == Components.interfaces.nsIPermissionManager.ALLOW_ACTION)
{
- s1tony.CM.prefObserver.setCookiePref(new Array(0, 0));
+ this._cm.prefObserver.setCookiePref(new Array(0, 0));
}
else if (currentSiteAccess == Components.interfaces.nsICookiePermission.ACCESS_SESSION)
{
- s1tony.CM.prefObserver.setCookiePref(new Array(0, 2));
+ this._cm.prefObserver.setCookiePref(new Array(0, 2));
}
else
{
@@ -1114,24 +1157,24 @@ s1tony.CM.cookieMonster =
if (this._usingGlobalOverride)
{
- s1tony.CM.cookieInfo.addOverrideGlobal(this._oldURL.asciiHost, domainType);
+ this._cm.cookieInfo.addOverrideGlobal(this._oldURL.asciiHost, domainType);
}
else
{
- s1tony.CM.cookieInfo.removeOverrideGlobal(this._oldURL.asciiHost, domainType);
+ this._cm.cookieInfo.removeOverrideGlobal(this._oldURL.asciiHost, domainType);
}
},
extResetGlobalCookiePref: function()
{
// Have the global permissions been changed
- var curGlobalCookie = s1tony.CM.prefObserver.getCookiePrefArray();
+ var curGlobalCookie = this._cm.prefObserver.getCookiePrefArray();
//alert("curGlobalCookie: " + curGlobalCookie + " defaultGlobPref: " + this._currentGlobalPreference);
if ((curGlobalCookie[CM_PREF_COOKIE_BEHAVIOR] != this._currentGlobalPreference[CM_PREF_COOKIE_BEHAVIOR]) ||
(curGlobalCookie[CM_PREF_LIFETIME_POLICY] != this._currentGlobalPreference[CM_PREF_LIFETIME_POLICY]))
{
- s1tony.CM.prefObserver.setCookiePref(this._currentGlobalPreference);
+ this._cm.prefObserver.setCookiePref(this._currentGlobalPreference);
}
},
@@ -1139,47 +1182,45 @@ s1tony.CM.cookieMonster =
// to the menu choices made by the user
extMenuCommandHandler: function(evt)
{
- var checkExpCookie = /^cookie-access/i;
- var checkExpOptions = /^option-/i;
+ var checkExpCookie = /^cookiemonster-s1tony-access/i;
+ var checkExpOptions = /^cookiemonster-s1tony-option-/i;
var itemPicked = null;
- var accessString = null;
- var accessValue = null;
+ //var accessString = null;
+ //var accessValue = null;
var itemPicked = document.getElementById(evt.target.id);
//alert("Menu Command Event Id: " + evt.target.id + " CM_TOP_LEVEL: " + this._oldAccess[CM_TOP_LEVEL]);
- // Set menu event flag so we don't double trigger a permissions update
+ // Set menu event flag so we don't double trigger a permissions update
this._flagMenuEvent = true;
// If id contains cookie-access and name = cookie, then assign new
// cookie access and reload page
if (checkExpCookie.test(evt.target.id))
{
- if (itemPicked.getAttribute("name") == "cookie-top")
- {
- this.extSetCookieAccess(evt.target.value, CM_TOP_LEVEL);
- }
- else if(itemPicked.getAttribute("name") == "cookie-two")
- {
- this.extSetCookieAccess(evt.target.value, CM_SECOND_LEVEL);
- }
- else if(itemPicked.getAttribute("name") == "cookie-access")
- {
- if (this._secondLevel)
- {
- this.extSetCookieAccess(evt.target.value, CM_SECOND_LEVEL);
- }
- else
- {
- this.extSetCookieAccess(evt.target.value, CM_TOP_LEVEL);
- }
- }
- else if(itemPicked.getAttribute("name") == "cookie-default")
+ switch (itemPicked.getAttribute("name"))
{
- this.extSetCookieAccess(evt.target.value, CM_TOP_LEVEL);
- this.extSetCookieAccess(evt.target.value, CM_SECOND_LEVEL);
+ case "cookie-top":
+ this.extSetCookieAccess(evt.target.value, CM_TOP_LEVEL);
+ break;
+ case "cookie-two":
+ this.extSetCookieAccess(evt.target.value, CM_SECOND_LEVEL);
+ break;
+ case "cookie-access":
+ case "current-access":
+ // Even though updating current-access may seem unnecessary,
+ // if user is processing both http and https and only is set,
+ // this will make sure both are set
+ this.extSetCookieAccess(evt.target.value, this._secondLevel ? CM_SECOND_LEVEL : CM_TOP_LEVEL);
+ break;
+ case "cookie-default":
+ this.extSetCookieAccess(evt.target.value, CM_TOP_LEVEL);
+ this.extSetCookieAccess(evt.target.value, CM_SECOND_LEVEL);
+ break;
+ default:
+ break;
}
-
+
// Only reload page if reloadOnPermissionChange preference == true
if (this._reloadOnPermissionChange)
{
@@ -1187,23 +1228,28 @@ s1tony.CM.cookieMonster =
}
//accessString = cookieMonster_CookieInfo.getPermissionString(evt.target.value);
- this.updateStatusbarMenu(this._oldURL.asciiHost, this._oldAccess);
+ this.updateStatusbarMenu(this._oldURL, this._oldAccess);
}
else if (checkExpOptions.test(evt.target.id))
{
- // If id=second-level, then determine
- // if it is checked and set variable and
- // user preference cookiemonster.secondlevelurl and
- // call switchCookieSubMenu to check if the cookie
- // submenu needs to be switched
- // Else if id = this._globalOverrideId, then
- // update user cookie preferences
- if ((evt.target.id == this._secondLevelId) &&
- (this._secondLevel != itemPicked.getAttribute("checked")))
- {
- this._secondLevel = itemPicked.getAttribute("checked");
- s1tony.CM.nsPreferences.setBoolPref("secondlevelurl", this._secondLevel);
- }
+ var itemChecked = itemPicked.getAttribute("checked");
+
+ // Update settings and menu
+ if ((evt.target.id == this._secondLevelId) && (this._secondLevel != itemChecked))
+ {
+ // If id=second-level, then determine
+ // if it is checked and set variable and
+ // user preference cookiemonster.secondlevelurl and
+ // call switchCookieSubMenu to check if the cookie
+ // submenu needs to be switched
+ this._secondLevel = itemChecked;
+ this._cm.nsPreferences.setBoolPref("secondlevelurl", this._secondLevel);
+ }
+ else if ((evt.target.id == this._bothSchemesId) && (this._processHttpAndHttps != itemChecked))
+ {
+ this._processHttpAndHttps = itemChecked;
+ this._cm.nsPreferences.setBoolPref("bothhttpandhttps", this._processHttpAndHttps);
+ }
/* else if((evt.target.id == this._globalOverrideId) &&
(this._usingGlobalOverride != itemPicked.getAttribute("checked")))
{
@@ -1226,25 +1272,23 @@ s1tony.CM.cookieMonster =
*/
extThirdPartyMenuLoadHandler: function(evt)
{
- var cookieRequestData = s1tony.CM.cookieRequest.getRequestList(this._oldURL.asciiHost);
+ var cookieRequestData = this._cm.cookieRequest.getRequestList(this._oldURL.asciiHost);
this.setThirdPartyCookieSubMenu(cookieRequestData);
- //alert("length: " + cookieRequestData.length);
evt.stopPropagation();
},
/**
* Handle the command event for the third party menu items
* @param {Event} evt
- * @param {String} aHost
+ * @param {nsIURI} ahostURI
*/
- extThirdPartyMenuSiteHandler: function(evt, aHost)
+ extThirdPartyMenuSiteHandler: function (evt, ahostURI)
{
- var hostURI = s1tony.CM.utils.createURIFromHostName(aHost);
- s1tony.CM.cookieInfo.setCookieAccess(hostURI, evt.target.value, CM_TOP_LEVEL);
+ this._cm.cookieInfo.setCookieAccess(ahostURI, evt.target.value, CM_TOP_LEVEL, this._processHttpAndHttps);
if (!this._reloadOnPermissionChange)
{
- s1tony.CM.cookieRequest.updateCookieRequest(aHost, this._oldURL.asciiHost);
+ this._cm.cookieRequest.updateCookieRequest(ahostURI, this._oldURL.asciiHost);
}
evt.stopPropagation();
@@ -1254,7 +1298,7 @@ s1tony.CM.cookieMonster =
* Handle the command event for the third party menu items
* of temp allow all or temp allow revoke
* @param {Event} evt
- * @param {String[]} aHosts
+ * @param {nsIURI[]} aHosts
* @optional {Boolean} aRevoke
*/
extThirdPartyMenuAllHandler: function(evt, aHosts /*, aRevoke */)
@@ -1262,21 +1306,21 @@ s1tony.CM.cookieMonster =
var aRevoke = false || Boolean(arguments[2]);
aHosts.forEach(
- function(host, index)
+ function (hostURI, index)
{
if (!aRevoke)
{
- var hostURI = s1tony.CM.utils.createURIFromHostName(host);
- s1tony.CM.cookieInfo.setCookieAccess(hostURI, -1, CM_TOP_LEVEL);
+ //var hostURI = this._cm.utils.createURIFromHostName(host);
+ this._cm.cookieInfo.setCookieAccess(hostURI, -1, CM_TOP_LEVEL, this._processHttpAndHttps);
}
else
{
- s1tony.CM.tempAllow.resetTempCookie(host);
+ this._cm.tempAllow.resetTempCookie(hostURI.prePath);
}
if (!this._reloadOnPermissionChange)
{
- s1tony.CM.cookieRequest.updateCookieRequest(host, this._oldURL.asciiHost);
+ this._cm.cookieRequest.updateCookieRequest(hostURI, this._oldURL.asciiHost);
}
}, this
);
@@ -1292,12 +1336,12 @@ s1tony.CM.cookieMonster =
extSetSiteRequestedSetCookie: function(evt)
{
- var cookieTooltipAttempt = document.getElementById("cookie-group-attempt");
+ var cookieTooltipAttempt = document.getElementById("cookiemonster-s1tony-group-attempt");
var attemptDisplay = null;
// Set the tool tip text indicating if the site has requested
// to leave cookies
- if (s1tony.CM.cookieRequest.hasMadeCookieRequest(this._oldURL.asciiHost))
+ if (this._cm.cookieRequest.hasMadeCookieRequest(this._oldURL.asciiHost))
{
attemptDisplay = this._menuBundle.getString("siteattemptedcookie");
}
@@ -1314,84 +1358,92 @@ s1tony.CM.cookieMonster =
// Set values based on preferences
extUpdateFromPreferences: function(aPref)
{
- var globalOverridePref = null;
-
- if (aPref == "secondlevelurl")
+ switch (aPref)
{
- this._secondLevel = s1tony.CM.nsPreferences.getBoolPref("secondlevelurl", false);
+ case "secondlevelurl":
+ this._secondLevel = this._cm.nsPreferences.getBoolPref(aPref, false);
+ this._secondLevelMenuOption.setAttribute("checked", this._secondLevel);
+ this.updateStatusbarMenu(this._oldURL, this._oldAccess);
+ this.switchCookieSubMenu();
+
+ break;
+ case "enableglobalcookieoverride":
+ // Retrieve the new value for enableglobalcookieoverride
+ var globalOverridePref = this._cm.nsPreferences.getBoolPref(aPref, false);
+
+ // If enableglobalcookieoverride has changed then assign
+ // the updated value, update the menu, reset global cookie
+ // prefs if _allowGlobalOverride is false, and reload page
+ // if the current URI is using global override
+ if (this._allowGlobalOverride != globalOverridePref)
+ {
+ this._allowGlobalOverride = globalOverridePref;
+ this._globalOverrideMenuOption.setAttribute("disabled", !this._allowGlobalOverride);
+
+ if (!this._allowGlobalOverride)
+ {
+ this.extResetGlobalCookiePref();
+ }
+
+ if (this._usingGlobalOverride)
+ {
+ gBrowser.reload(gBrowser.webNavigation.LOAD_FLAGS_BYPASS_CACHE);
+ }
+ }
- if (this._secondLevel)
- {
- this._secondLevelMenuOption.setAttribute("checked", "true");
- }
- else
- {
- this._secondLevelMenuOption.setAttribute("checked", "false");
- }
+ break;
+ case "enablekeyboardshortcut":
+ if (!cookieMonsterBys1tony.nsPreferences.getBoolPref("enablekeyboardshortcut", true))
+ {
+ document.getElementById("cookiemonster-s1tony-key").setAttribute("disabled", true);
+ }
+ else
+ {
+ document.getElementById("cookiemonster-s1tony-key").removeAttribute("disabled");
+ }
- this.updateStatusbarMenu(this._oldURL.asciiHost, this._oldAccess);
- this.switchCookieSubMenu();
- }
- else if (aPref == "enableglobalcookieoverride")
- {
- // Retrieve the new value for enableglobalcookieoverride
- globalOverridePref = s1tony.CM.nsPreferences.getBoolPref("enableglobalcookieoverride", false);
-
- // If enableglobalcookieoverride has changed then assign
- // the updated value, update the menu, reset global cookie
- // prefs if _allowGlobalOverride is false, and reload page
- // if the current URI is using global override
- if (this._allowGlobalOverride != globalOverridePref)
- {
- this._allowGlobalOverride = globalOverridePref;
- this._globalOverrideMenuOption.setAttribute("disabled", !this._allowGlobalOverride);
+ break;
+ case "originaldefaulticon":
+ // Determine what default icon to use
+ if (!this._cm.nsPreferences.getBoolPref(aPref, false))
+ {
+ this._iconList[CM_COOKIE_ACCESS_DEFAULT] = CM_ICON_DEFAULT;
+ }
+ else
+ {
+ this._iconList[CM_COOKIE_ACCESS_DEFAULT] = CM_ICON_DEFAULT_ORIGINAL;
+ }
- if (!this._allowGlobalOverride)
- {
- this.extResetGlobalCookiePref();
- }
-
- if (this._usingGlobalOverride)
- {
- gBrowser.reload(gBrowser.webNavigation.LOAD_FLAGS_BYPASS_CACHE);
- }
- }
- }
- else if (aPref == "enablekeyboardshortcut")
- {
- document.getElementById("cookiemonster-key").setAttribute("disabled", !s1tony.CM.nsPreferences.getBoolPref("enablekeyboardshortcut", true));
- }
- else if (aPref == "originaldefaulticon")
- {
- // Determine what default icon to use
- if (!s1tony.CM.nsPreferences.getBoolPref("originaldefaulticon", false))
- {
- this._iconList[CM_COOKIE_ACCESS_DEFAULT] = CM_ICON_DEFAULT;
- }
- else
- {
- this._iconList[CM_COOKIE_ACCESS_DEFAULT] = CM_ICON_DEFAULT_ORIGINAL;
- }
-
- this.updateStatusbarMenu(this._oldURL.asciiHost, this._oldAccess);
- }
- else if (aPref == "reloadonpermissionchange")
- {
- this._reloadOnPermissionChange = s1tony.CM.nsPreferences.getBoolPref("reloadonpermissionchange", false);
- }
- else if ((aPref == "cookieBehavior") || (aPref == "lifetimePolicy"))
- {
- // Retrieve users's updated default cookie permissions and
- // update Statusbar menu
- this._userDefault = s1tony.CM.prefObserver.getCookiePrefString();
-
- if (!this._flagGlobalCookieEvent)
- {
- this._currentGlobalPreference = s1tony.CM.prefObserver.getCookiePrefArray();
- }
-
- this.updateStatusbarMenu(this._oldURL.asciiHost, this._oldAccess);
- }
+ this.updateStatusbarMenu(this._oldURL, this._oldAccess);
+
+ break;
+ case "reloadonpermissionchange":
+ this._reloadOnPermissionChange = this._cm.nsPreferences.getBoolPref(aPref, false);
+
+ break;
+ case "bothhttpandhttps":
+ this._processHttpAndHttps = this._cm.nsPreferences.getBoolPref(aPref, false);
+ this._bothSchemesMenuOption.setAttribute("checked", this._processHttpAndHttps);
+ this.updateStatusbarMenu(this._oldURL, this._oldAccess);
+
+ break;
+ case "cookieBehavior":
+ case "lifetimePolicy":
+ // Retrieve users's updated default cookie permissions and
+ // update Statusbar menu
+ this._userDefault = this._cm.prefObserver.getCookiePrefString();
+
+ if (!this._flagGlobalCookieEvent)
+ {
+ this._currentGlobalPreference = this._cm.prefObserver.getCookiePrefArray();
+ }
+
+ this.updateStatusbarMenu(this._oldURL, this._oldAccess);
+
+ break;
+ default:
+ break;
+ }
},
// Set values based on permissions
@@ -1402,7 +1454,7 @@ s1tony.CM.cookieMonster =
// If the user has selected 2nd Level domains, then compare as such
if (this._secondLevel)
{
- currentURL = s1tony.CM.cookieInfo.getSecondLevelHost(this._oldURL.host);
+ currentURL = this._cm.cookieInfo.getSecondLevelHost(this._oldURL.host);
}
// Retrieve new cookies permission for current URL, reload page and
@@ -1410,7 +1462,7 @@ s1tony.CM.cookieMonster =
if ((aHost == currentURL) && !this._flagMenuEvent)
{
//alert("Permission Event and Not Menu Event: " + this._oldAccess);
- this._oldAccess = s1tony.CM.cookieInfo.checkPermissionArray(this._oldURL, CM_PERMISSION_TYPE_COOKIE);
+ this._oldAccess = this._cm.cookieInfo.checkPermissionArray(this._oldURL, CM_PERMISSION_TYPE_COOKIE);
// Only reload page if reloadOnPermissionChange preference == true
if (this._reloadOnPermissionChange)
@@ -1418,14 +1470,14 @@ s1tony.CM.cookieMonster =
gBrowser.reload(gBrowser.webNavigation.LOAD_FLAGS_BYPASS_CACHE);
}
- this.updateStatusbarMenu(this._oldURL.asciiHost, this._oldAccess);
+ this.updateStatusbarMenu(this._oldURL, this._oldAccess);
}
}
};
// Edit: for me on Firefox 2.0, I had to change "document" to "window"
// for the following lines to work
-window.addEventListener("load", function() {s1tony.CM.cookieMonster.init()},
+window.addEventListener("load", function () { cookieMonsterBys1tony.cookieMonster.init() },
false);
-window.addEventListener("unload", function() {s1tony.CM.cookieMonster.uninit()},
+window.addEventListener("unload", function () { cookieMonsterBys1tony.cookieMonster.uninit() },
false);
diff --git a/chrome/cookiemonster.jar!/content/cookiePreferences.js b/chrome/cookiemonster.jar!/content/cookiePreferences.js
index 8a588f7..54e9325 100644
--- a/chrome/cookiemonster.jar!/content/cookiePreferences.js
+++ b/chrome/cookiemonster.jar!/content/cookiePreferences.js
@@ -1,9 +1,9 @@
/**
- * s1tony.CM.nsPreferences - a wrapper around nsIPrefService. Provides built in
+ * cookieMonsterBys1tony.nsPreferences - a wrapper around nsIPrefService. Provides built in
* exception handling to make preferences access simpler.
* Based on chrome://global/content/nsUserSettings.js
**/
-s1tony.CM.nsPreferences =
+cookieMonsterBys1tony.nsPreferences =
{
_branch: null,
@@ -201,7 +201,7 @@ s1tony.CM.nsPreferences =
};
// Observer to notify when preferences are changed
-s1tony.CM.prefObserver =
+cookieMonsterBys1tony.prefObserver =
{
_branchExt: null,
_branchNetworkCookie: null,
@@ -220,7 +220,7 @@ s1tony.CM.prefObserver =
this._branchNetworkCookie.addObserver("", this, false);
// Create a reference to all the menu elements
- this._menuBundle = document.getElementById("cookie-menu-labels");
+ this._menuBundle = document.getElementById("cookiemonster-s1tony-menu-labels");
},
unregister: function()
@@ -241,7 +241,7 @@ s1tony.CM.prefObserver =
// aSubject is the nsIPrefBranch we're observing (after appropriate QI)
// aData is the name of the pref that's been changed (relative to aSubject)
- s1tony.CM.cookieMonster.extUpdateFromPreferences(aData);
+ cookieMonsterBys1tony.cookieMonster.extUpdateFromPreferences(aData);
// switch (aData) {
// case "secondlevelurl":
// cookieMonster.extUpdateFromPreferences(aData);
@@ -339,10 +339,11 @@ s1tony.CM.prefObserver =
// Observer to notify when cookie permissions have changed and
// when the browser is shutting down
-s1tony.CM.observerService =
+cookieMonsterBys1tony.observerService =
{
_permService: null,
_nsIHttpChannel: Components.interfaces.nsIHttpChannel,
+ _cm: cookieMonsterBys1tony,
// Ensure the observers are only added once
register: function()
@@ -378,7 +379,7 @@ s1tony.CM.observerService =
if (permission.type == "cookie")
{
//alert("Perm Observer Host: " + permission.host + " Topic: " + aTopic + " Data: " + aData);
- s1tony.CM.cookieMonster.extUpdateFromPermissions(permission.host);
+ this._cm.cookieMonster.extUpdateFromPermissions(permission.host);
}
}
else if (aTopic == "quit-application-requested")
@@ -394,11 +395,11 @@ s1tony.CM.observerService =
// being closed by clicking the close [x] button
// for the actual window
//alert("quit-application-requested " + " Topic: " + aTopic + " Data: " + aData);
- s1tony.CM.cookieMonster.extResetTempCookies(true);
+ this._cm.cookieMonster.extResetTempCookies(true);
// Also restore the user's current global cookie
// permission preferences if override global is used
- s1tony.CM.cookieMonster.extResetGlobalCookiePref();
+ this._cm.cookieMonster.extResetGlobalCookiePref();
}
else if (aTopic == "http-on-examine-response" || aTopic == "http-on-examine-cached-response")
{
@@ -406,18 +407,26 @@ s1tony.CM.observerService =
if (httpChannel.visitResponseHeaders)
{
- httpChannel.visitResponseHeaders(s1tony.CM.headerVisitor);
+ httpChannel.visitResponseHeaders(this._cm.headerVisitor);
}
- if (s1tony.CM.headerVisitor.isCookieRequest())
+ if (this._cm.headerVisitor.isCookieRequest())
{
- httpChannel.visitRequestHeaders(s1tony.CM.headerVisitor);
- var browser = s1tony.CM.utils.getBrowserFromChannel(httpChannel);
+ httpChannel.visitRequestHeaders(this._cm.headerVisitor);
+ var browser = this._cm.utils.getBrowserFromChannel(httpChannel);
if (browser)
- {
- s1tony.CM.cookieRequest.addCookieRequest(s1tony.CM.headerVisitor.getHost(),
- browser, s1tony.CM.headerVisitor.isDomainCookie());
+ {
+ // Retrieve URI from httpChannel, if available
+ if (httpChannel.URI)
+ {
+ //console.log("Have URI: " + httpChannel.URI.prePath);
+ this._cm.cookieRequest.addCookieRequest(httpChannel.URI, browser, this._cm.headerVisitor.isDomainCookie());
+ }
+ else
+ {
+ //console.log("Do not have URI for : " + this._cm.headerVisitor.getHost());
+ }
}
else
{
@@ -425,12 +434,12 @@ s1tony.CM.observerService =
}
}
- s1tony.CM.headerVisitor.reset();
+ this._cm.headerVisitor.reset();
}
}
};
-s1tony.CM.headerVisitor =
+cookieMonsterBys1tony.headerVisitor =
{
_isCookieRequest: false,
_isDomainCookie: false,
diff --git a/chrome/cookiemonster.jar!/content/cookieRequest.js b/chrome/cookiemonster.jar!/content/cookieRequest.js
index 557bf24..7833f94 100644
--- a/chrome/cookiemonster.jar!/content/cookieRequest.js
+++ b/chrome/cookiemonster.jar!/content/cookieRequest.js
@@ -1,12 +1,14 @@
/**
* Store cookie requests for each browser host
- * @type s1tony.CM.cookieRequest
+ * @type cookieMonsterBys1tony.cookieRequest
*/
-s1tony.CM.cookieRequest =
+cookieMonsterBys1tony.cookieRequest =
{
_uriList: new Object(),
_browserList: new Array(),
-
+ //_testList: new Array(),
+ _cm: cookieMonsterBys1tony,
+
init: function()
{
// Do nothing for now
@@ -35,18 +37,24 @@ s1tony.CM.cookieRequest =
{
for (; from < len; from++)
{
- if (from in aList &&
- aList[from].host === elt.host)
- return from;
+ //if (from in aList &&
+ // aList[from].host === elt.host)
+ if (from in aList && aList[from].uri.equalsExceptRef(elt.uri))
+ {
+ return from;
+ }
}
}
else
{
for (; from < len; from++)
{
- if (from in aList &&
- s1tony.CM.cookieInfo.getSecondLevelHost(aList[from].host) === elt.host)
- return from;
+ //if (from in aList &&
+ // this._cm.cookieInfo.getSecondLevelHost(aList[from].host) === elt.host)
+ if (from in aList && this._cm.cookieInfo.getSecondLevelURI(aList[from].uri).equalsExceptRef(elt.uri))
+ {
+ return from;
+ }
}
}
@@ -107,19 +115,28 @@ s1tony.CM.cookieRequest =
*/
addCookieRequest: function(aCookieHost, aBrowser, aIsDomain)
{
+ //console.log("Got to addCookieRequest");
+
if (aBrowser)
{
// Check if this browser is already contained in the list
var browserIndex = this._requestPropertyIndexOf(this._browserList, 'browser', aBrowser);
- var cookieHostInfo = {host: aCookieHost, isDomain: aIsDomain};
+ var cookieHostInfo = { host: aCookieHost.prePath, isDomain: aIsDomain };
+
+ //console.log("Got to addCookieRequest with an aCookieHost: " + aCookieHost.asciiHost);
+ //console.log("Got to addCookieRequest with aBrowser: " + aBrowser.lastURI.asciiHost);
if (browserIndex > -1)
{
this._browserList[browserIndex].cookieRequestList.push(cookieHostInfo);
+ //this._testList.push(cookieHostInfo);
+ //console.log("Got to addCookieRequest for existing browser adding cookieHostInfo: " + cookieHostInfo.host);
}
else
{
- this._browserList.push({browser: aBrowser, cookieRequestList: new Array(cookieHostInfo)});
+ this._browserList.push({ browser: aBrowser, cookieRequestList: new Array(cookieHostInfo) });
+ //this._testList.push(cookieHostInfo);
+ //console.log("Got to addCookieRequest for new browser adding cookieHostInfo: " + cookieHostInfo.host);
}
//alert("Add Cookie Request Browser: " + aBrowser.currentURI.asciiHost + " cookieURI: " + aCookieURI);
@@ -155,17 +172,17 @@ s1tony.CM.cookieRequest =
{
if (!(aCookieURI instanceof Components.interfaces.nsIURI))
{
- aCookieURI = s1tony.CM.utils.createURIFromHostName(aCookieURI);
+ aCookieURI = this._cm.utils.createURIFromHostName(aCookieURI, true);
}
var aIsDomain = arguments[2] ? Boolean(arguments[2]) : false;
- var secondLevelCookieHost = s1tony.CM.cookieInfo.getSecondLevelHost(aCookieURI.host);
+ var secondLevelCookieHost = this._cm.cookieInfo.getSecondLevelHost(aCookieURI.asciiHost);
var secondLevelLoadHost;
// First of all, check to see if aLoadHost is null
if (aLoadHost != null)
{
- secondLevelLoadHost = s1tony.CM.cookieInfo.getSecondLevelHost(aLoadHost);
+ secondLevelLoadHost = this._cm.cookieInfo.getSecondLevelHost(aLoadHost);
// Check if this host is already contained in the list
if (!this._uriList.hasOwnProperty(aLoadHost))
@@ -184,15 +201,15 @@ s1tony.CM.cookieRequest =
// aCookieURI to a domain
if (aIsDomain)
{
- aCookieURI = s1tony.CM.cookieInfo.getSecondLevelURI(aCookieURI);
+ aCookieURI = this._cm.cookieInfo.getSecondLevelURI(aCookieURI);
}
// Check if URI already has a non-default cookie access
// Use CM_URL_STANDARD_LEVEL in order to reflect the result
// of aCookieURI
- var accessLevel = s1tony.CM.cookieInfo.checkPermissionArray(aCookieURI, CM_PERMISSION_TYPE_COOKIE);
- var accessValue = s1tony.CM.cookieInfo.getPermissionValue(accessLevel[CM_URL_STANDARD_LEVEL]);
- var cookieInfo = {host: aCookieURI.asciiHost, accessValue: accessValue};
+ var accessLevel = this._cm.cookieInfo.checkPermissionArray(aCookieURI, CM_PERMISSION_TYPE_COOKIE);
+ var accessValue = this._cm.cookieInfo.getPermissionValue(accessLevel[CM_URL_STANDARD_LEVEL]);
+ var cookieInfo = {uri: aCookieURI, accessValue: accessValue};
// Check if this URI is already contained in the list for the host and
// if so, check to see if the accessValue has changed
@@ -229,26 +246,26 @@ s1tony.CM.cookieRequest =
this._uriList[aLoadHost].cookieRequestList.forEach(
function(tempCookieItem, index)
{
- this._processCookieRequest(tempCookieItem.host, aLoadHost);
+ this._processCookieRequest(tempCookieItem.uri, aLoadHost);
}, this
);
}
},
/**
- * Update the cookie info for aCookieHost
- * @param {String} aCookieHost
+ * Update the cookie info for aCookieHostURI
+ * @param {nsIURI [could also accept String]} aCookieHostURI
* @param {String} aHost
*/
- updateCookieRequest: function(aCookieHost, aHost)
+ updateCookieRequest: function(aCookieHostURI, aHost)
{
- this._processCookieRequest(aCookieHost, aHost);
+ this._processCookieRequest(aCookieHostURI, aHost);
},
/**
* Retrieve cookie request list for aLoadHost
* @param {String} aLoadHost
- * @return {cookieInfo[]} cookieInfo {host: accessValue:} objects
+ * @return {cookieInfo[]} cookieInfo {uri: accessValue:} objects
*/
getRequestList: function(aLoadHost)
{
@@ -305,7 +322,7 @@ s1tony.CM.cookieRequest =
{
//alert("uriList contains " + aLoadHost);
- if (!s1tony.CM.utils.isUrlMultipleTabs(aLoadHost, true))
+ if (!this._cm.utils.isUrlMultipleTabs(aLoadHost, true))
{
//alert(aLoadHost + " only open in one tab, so deleting host");
delete this._uriList[aLoadHost];
diff --git a/chrome/cookiemonster.jar!/content/cookieTempAllow.js b/chrome/cookiemonster.jar!/content/cookieTempAllow.js
index 962995d..37893bf 100644
--- a/chrome/cookiemonster.jar!/content/cookieTempAllow.js
+++ b/chrome/cookiemonster.jar!/content/cookieTempAllow.js
@@ -1,10 +1,12 @@
/**
* Handle Temporary Allow List by maintaining the config preference
* CM_PREFERENCE_TYPE_COOKIE_TEMP
- * @type s1tony.CM.tempAllow
+ * @type cookieMonsterBys1tony.tempAllow
*/
-s1tony.CM.tempAllow =
+cookieMonsterBys1tony.tempAllow =
{
+ _cm: cookieMonsterBys1tony,
+
init: function()
{
// Do nothing for now
@@ -42,7 +44,7 @@ s1tony.CM.tempAllow =
for (; from < len; from++)
{
if (from in aList &&
- s1tony.CM.cookieInfo.getSecondLevelHost(aList[from].split(';')[0]) === elt)
+ this._cm.cookieInfo.getSecondLevelHost(aList[from].split(';')[0]) === elt)
return from;
}
}
@@ -52,40 +54,44 @@ s1tony.CM.tempAllow =
add: function(aURI)
{
- // Check if URI already has a non-default cookie access
- // Use CM_TOP_LEVEL because the level is already inherently defined
- // by aURI in this case
- var accessLevel = s1tony.CM.cookieInfo.checkPermissionArray(aURI, CM_PERMISSION_TYPE_COOKIE);
- var accessValue = s1tony.CM.cookieInfo.getPermissionValue(accessLevel[CM_TOP_LEVEL]);
+ // Only add if not already added
+ if (!this.isTempPermission(aURI))
+ {
+ // Check if URI already has a non-default cookie access
+ // Use CM_TOP_LEVEL because the level is already inherently defined
+ // by aURI in this case
+ var accessLevel = this._cm.cookieInfo.checkPermissionArray(aURI, CM_PERMISSION_TYPE_COOKIE);
+ var accessValue = this._cm.cookieInfo.getPermissionValue(accessLevel[CM_TOP_LEVEL]);
- s1tony.CM.nsPreferences.setAppendToStringPref(CM_PREFERENCE_TYPE_COOKIE_TEMP, aURI.asciiHost + ';' + accessValue);
+ this._cm.nsPreferences.setAppendToStringPref(CM_PREFERENCE_TYPE_COOKIE_TEMP, aURI.prePath + ';' + accessValue);
+ }
},
remove: function(aURI)
{
- s1tony.CM.nsPreferences.setRemoveFromStringPref(CM_PREFERENCE_TYPE_COOKIE_TEMP, aURI.asciiHost);
+ this._cm.nsPreferences.setRemoveFromStringPref(CM_PREFERENCE_TYPE_COOKIE_TEMP, aURI.prePath);
},
// Check to see if aURI is a temporary permission
isTempPermission: function(aURI)
{
- var retValue = false;
- var tempList = s1tony.CM.nsPreferences.getStringPrefArray(CM_PREFERENCE_TYPE_COOKIE_TEMP);
-
- // Each array item should contain a URI and a cookie preference,
- // separated by a semicolon
- for (var i = 0; i < tempList.length; i++)
- {
- var tempItem = tempList[i].split(';');
-
- if (tempItem[0] === aURI.asciiHost)
- {
- retValue = true;
- break;
- }
- }
-
- return retValue;
+ var retValue = false;
+ var tempList = this._cm.nsPreferences.getStringPrefArray(CM_PREFERENCE_TYPE_COOKIE_TEMP);
+
+ // Each array item should contain a URI and a cookie preference,
+ // separated by a semicolon
+ for (var i = 0; i < tempList.length; i++)
+ {
+ var tempItem = tempList[i].split(';');
+
+ if (tempItem[0] === aURI.prePath)
+ {
+ retValue = true;
+ break;
+ }
+ }
+
+ return retValue;
},
/**
@@ -96,52 +102,49 @@ s1tony.CM.tempAllow =
*/
resetTempCookie: function(aHost)
{
- var retValue = null;
- var tempList = s1tony.CM.nsPreferences.getStringPrefArray(CM_PREFERENCE_TYPE_COOKIE_TEMP);
-
- // Retrieve index position for aURI
- var hostIndex = this._requestHostIndexOf(tempList, aHost);
- //alert("Got to resetTempCookie: hostIndex: " + hostIndex + " " + tempList[hostIndex]);
-
- // Reset cookie permissions back to previous setting and
- // remove from preference string
- if (hostIndex > -1)
- {
- this._resetTempCookieValues(tempList[hostIndex], hostIndex);
- s1tony.CM.nsPreferences.setRemoveFromStringPref(CM_PREFERENCE_TYPE_COOKIE_TEMP, aHost);
- retValue = tempList[hostIndex].split(';')[1];
- }
-
- return retValue;
+ var retValue = null;
+ var tempList = this._cm.nsPreferences.getStringPrefArray(CM_PREFERENCE_TYPE_COOKIE_TEMP);
+
+ // Retrieve index position for aURI
+ var hostIndex = this._requestHostIndexOf(tempList, aHost);
+ //alert("Got to resetTempCookie: hostIndex: " + hostIndex + " " + tempList[hostIndex]);
+
+ // Reset cookie permissions back to previous setting and
+ // remove from preference string
+ if (hostIndex > -1)
+ {
+ this._resetTempCookieValues(tempList[hostIndex], hostIndex);
+ this._cm.nsPreferences.setRemoveFromStringPref(CM_PREFERENCE_TYPE_COOKIE_TEMP, aHost);
+ retValue = tempList[hostIndex].split(';')[1];
+ }
+
+ return retValue;
},
/**
* Reset temp cookie list
*/
- resetTempCookies: function()
- {
- var tempList = s1tony.CM.nsPreferences.getStringPrefArray(CM_PREFERENCE_TYPE_COOKIE_TEMP);
- tempList.forEach(this._resetTempCookieValues, this);
-
- s1tony.CM.nsPreferences.clearUserPref(CM_PREFERENCE_TYPE_COOKIE_TEMP);
- },
+ resetTempCookies: function()
+ {
+ var tempList = this._cm.nsPreferences.getStringPrefArray(CM_PREFERENCE_TYPE_COOKIE_TEMP);
+ tempList.forEach(this._resetTempCookieValues, this);
+
+ this._cm.nsPreferences.clearUserPref(CM_PREFERENCE_TYPE_COOKIE_TEMP);
+ },
// Delete temp cookies from host and reset temp cookie permissions
- _resetTempCookieValues: function(aItem, aIndex)
- {
- var hostURI = null;
- var item = aItem.split(';');
- var host = item[0];
- var prefSetting = item[1];
-
- // Set aUseBaseDomain to true
- s1tony.CM.cookieInfo.deleteHostCookies(host, true);
-
- //alert("resetTempCookieValues: Host: " + host + " Previous Setting: " + prefSetting);
-
- hostURI = s1tony.CM.utils.createURIFromHostName(host);
+ _resetTempCookieValues: function(aItem, aIndex)
+ {
+ var hostURI = null;
+ var item = aItem.split(';');
+ var host = item[0];
+ var prefSetting = item[1];
+
+ // Set aUseBaseDomain to true
+ hostURI = this._cm.utils.createURIFromHostName(host, true);
+ this._cm.cookieInfo.deleteHostCookies(hostURI.asciiHost, true);
- // Reset cookie permissions back to previous setting
- s1tony.CM.cookieInfo.choice.setAccess(hostURI, prefSetting);
+ // Reset cookie permissions back to previous setting
+ this._cm.cookieInfo.choice.setAccess(hostURI, prefSetting);
}
}
diff --git a/chrome/cookiemonster.jar!/content/cookieUtils.js b/chrome/cookiemonster.jar!/content/cookieUtils.js
index cebca3e..03bfa30 100644
--- a/chrome/cookiemonster.jar!/content/cookieUtils.js
+++ b/chrome/cookiemonster.jar!/content/cookieUtils.js
@@ -1,10 +1,10 @@
-s1tony.CM.utils =
+cookieMonsterBys1tony.utils =
{
_bundle: null,
init: function()
{
- this._bundle = document.getElementById("cookie-preferences");
+ this._bundle = document.getElementById("cookiemonster-s1tony-preferences");
},
getBrowserFromChannel: function (aChannel)
@@ -43,7 +43,7 @@ s1tony.CM.utils =
if (b.currentURI.asciiHost === aHost)
{
- if(++numberTabs >= 2)
+ if (++numberTabs >= 2)
{
break;
}
@@ -52,16 +52,16 @@ s1tony.CM.utils =
}
else
{
- var secondLevelHost = s1tony.CM.cookieInfo.getSecondLevelHost(aHost);
+ var secondLevelHost = cookieMonsterBys1tony.cookieInfo.getSecondLevelHost(aHost);
for (var i = 0; i < num; i++)
{
var b = gBrowser.getBrowserAtIndex(i);
- var secondLevelBrowserHost = s1tony.CM.cookieInfo.getSecondLevelHost(b.currentURI.asciiHost);
+ var secondLevelBrowserHost = cookieMonsterBys1tony.cookieInfo.getSecondLevelHost(b.currentURI.asciiHost);
if (secondLevelBrowserHost === secondLevelHost)
{
- if(++numberTabs >= 2)
+ if (++numberTabs >= 2)
{
break;
}
@@ -72,16 +72,18 @@ s1tony.CM.utils =
return (numberTabs >= 2);
},
- createURIFromHostName: function(aHostName)
+ createURIFromHostName: function (aHostName /*, isPrePath*/)
{
var newHost = null;
-
+ var isPrePath = arguments[1] ? Boolean(arguments[1]) : false;
+
try
{
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
- newHost = ioService.newURI("http://"+aHostName, null, null);
+ var hostName = isPrePath ? aHostName : "http://" + aHostName;
+ newHost = ioService.newURI(hostName, null, null);
}
catch(ex)
{
diff --git a/chrome/cookiemonster.jar!/content/options.xul b/chrome/cookiemonster.jar!/content/options.xul
index eeeca48..41845ce 100644
--- a/chrome/cookiemonster.jar!/content/options.xul
+++ b/chrome/cookiemonster.jar!/content/options.xul
@@ -14,6 +14,7 @@
<preference id="pref-cookiebehavior" name="network.cookie.cookieBehavior" type="int"
onchange="if (value == 2) {document.getElementById('check-denybydefault').checked = true;} else {document.getElementById('check-denybydefault').checked = false;} if (value == 1) {document.getElementById('check-thirdparty').checked = true;} else {document.getElementById('check-thirdparty').checked = false;} false;"/>
<preference id="pref-secondlevelurl" name="extensions.cookiemonster.secondlevelurl" type="bool"/>
+ <preference id="pref-bothhttpandhttps" name="extensions.cookiemonster.bothhttpandhttps" type="bool"/>
<preference id="pref-reloadonpermissionchange" name="extensions.cookiemonster.reloadonpermissionchange" type="bool"/>
<preference id="pref-enablecontextmenu" name="extensions.cookiemonster.enablecontextmenu" type="bool"/>
<preference id="pref-enablekeyboardshortcut" name="extensions.cookiemonster.enablekeyboardshortcut" type="bool"/>
@@ -26,7 +27,8 @@
<checkbox id="check-denybydefault" label="&denyCookiesDefault;" command="cmd_cookiebehavior"/>
<checkbox id="check-thirdparty" label="&thirdPartyCookies;" command="cmd_cookiebehavior"/>
<checkbox label="&secondlevel;" preference="pref-secondlevelurl"/>
- <checkbox label="&reloadonpermissionchange;" preference="pref-reloadonpermissionchange"/>
+ <checkbox label="&bothhttpandhttps;" preference="pref-bothhttpandhttps"/>
+ <checkbox label="&reloadonpermissionchange;" preference="pref-reloadonpermissionchange"/>
<checkbox label="&enablecontextmenu;" preference="pref-enablecontextmenu"/>
<checkbox label="&enablekeyboardshortcut;" preference="pref-enablekeyboardshortcut"/>
<checkbox label="&deletecookies;" preference="pref-deletecookiesondeny"/>
diff --git a/chrome/cookiemonster.jar!/content/overlay.js b/chrome/cookiemonster.jar!/content/overlay.js
index 61e44f2..e3e4bd4 100644
--- a/chrome/cookiemonster.jar!/content/overlay.js
+++ b/chrome/cookiemonster.jar!/content/overlay.js
@@ -1,4 +1,4 @@
-s1tony.CM.showCookieExceptions =
+cookieMonsterBys1tony.showCookieExceptions =
{
_siteCookiesWindow: "chrome://cookiemonster/content/siteCookies_ff36.xul",
@@ -13,7 +13,7 @@ s1tony.CM.showCookieExceptions =
onMenuItemCommand: function(evt)
{
- var bundlePreferences = document.getElementById("cookie-preferences");
+ var bundlePreferences = document.getElementById("cookiemonster-s1tony-preferences");
var windowAddress = "chrome://browser/content/preferences/permissions.xul";
var windowName = "cookieMonster_ShowExceptions";
var params =
@@ -27,14 +27,14 @@ s1tony.CM.showCookieExceptions =
introText : bundlePreferences.getString("cookiepermissionstext")
};
- if (evt.target.id == 'show-cookies' || evt.target.id == 'show-cookies-site')
+ if (evt.target.id == 'cookiemonster-s1tony-show-cookies' || evt.target.id == 'cookiemonster-s1tony-show-cookies-site')
{
//windowAddress = "chrome://browser/content/preferences/cookies.xul";
windowAddress = this._siteCookiesWindow;
windowName = "cookieMonster_ShowCookies";
params = {filterString : "", showSearch: true};
- if (evt.target.id == 'show-cookies-site')
+ if (evt.target.id == 'cookiemonster-s1tony-show-cookies-site')
{
//windowAddress = "chrome://cookiemonster/content/siteCookies.xul";
var currentDomain = document.getElementById(evt.target.id);
@@ -46,71 +46,69 @@ s1tony.CM.showCookieExceptions =
}
};
-s1tony.CM.showOverrideGlobal =
+cookieMonsterBys1tony.showOverrideGlobal =
{
// Callback method for overrideGlobal window
// to add, delete or delete all URI hosts
// from preference list
overrideListChange: function(aHost, aListType)
{
- var domainType = s1tony.CM.cookieMonster.extGetCurrentDomainType();
-
- //alert("Callback Host: " + aHost + " ListType: " + aListType);
-
+ var domainType = cookieMonsterBys1tony.cookieMonster.extGetCurrentDomainType();
+
switch (aListType)
{
case 0: // Add
- s1tony.CM.cookieInfo.addOverrideGlobal(aHost, domainType);
+ cookieMonsterBys1tony.cookieInfo.addOverrideGlobal(aHost, domainType);
break;
case 1: // Delete
- s1tony.CM.cookieInfo.removeOverrideGlobal(aHost, domainType);
+ cookieMonsterBys1tony.cookieInfo.removeOverrideGlobal(aHost, domainType);
break;
case 2: // Delete All and reload page
- s1tony.CM.cookieInfo.removeAllOverrideGlobal();
+ cookieMonsterBys1tony.cookieInfo.removeAllOverrideGlobal();
break;
default:
break;
}
// If aHost is the current host or if remove all, reload page
- if ((aHost != null) && (s1tony.CM.cookieMonster.extGetCurrentHost() == aHost))
+ if ((aHost != null) && (cookieMonsterBys1tony.cookieMonster.extGetCurrentHost() == aHost))
{
- s1tony.CM.cookieMonster.extReloadCurrentPage();
+ cookieMonsterBys1tony.cookieMonster.extReloadCurrentPage();
}
},
onMenuItemCommand: function(evt)
{
- var bundlePreferences = document.getElementById("cookie-preferences");
+ var bundlePreferences = document.getElementById("cookiemonster-s1tony-preferences");
var windowAddress = "chrome://cookiemonster/content/overrideGlobal.xul";
var windowName = "cookieMonster_ShowOverride";
var params =
{
- prefilledHost : s1tony.CM.cookieMonster.extGetCurrentHost(),
+ prefilledHost : cookieMonsterBys1tony.cookieMonster.extGetCurrentHost(),
//aURI : cookieMonster.extGetCurrentURI(),
//windowTitle : bundlePreferences.getString("cookiepermissionstitle"),
//introText : bundlePreferences.getString("cookiepermissionstext"),
- globalOverrideList: s1tony.CM.cookieInfo.getGlobalOverrideList()
+ globalOverrideList: cookieMonsterBys1tony.cookieInfo.getGlobalOverrideList()
};
var cookieWindow = window.openDialog(windowAddress, windowName, "modal=yes,chrome=yes,close=yes", params, this.overrideListChange);
}
};
-s1tony.CM.deleteCookies =
+cookieMonsterBys1tony.deleteCookies =
{
onMenuItemCommand: function(evt)
{
- var menuBundle = document.getElementById("cookie-menu-labels");
+ var menuBundle = document.getElementById("cookiemonster-s1tony-menu-labels");
var currentHost = null;
var result = true;
- if (evt.target.id == 'delete-cookies-site')
+ if (evt.target.id == 'cookiemonster-s1tony-delete-cookies-site')
{
- currentHost = s1tony.CM.cookieMonster.extGetCurrentHost();
+ currentHost = cookieMonsterBys1tony.cookieMonster.extGetCurrentHost();
// Display confirmation dialog, unless turned off in Options
- if (!s1tony.CM.nsPreferences.getBoolPref("disabledeletecookieconfirm", false))
+ if (!cookieMonsterBys1tony.nsPreferences.getBoolPref("disabledeletecookieconfirm", false))
{
var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
@@ -120,25 +118,26 @@ s1tony.CM.deleteCookies =
if (result)
{
- s1tony.CM.cookieInfo.deleteHostCookies(currentHost, true);
+ cookieMonsterBys1tony.cookieInfo.deleteHostCookies(currentHost, true);
}
-
- //alert("Cookies Deleted for " + currentHost);
}
}
};
-s1tony.CM.showCookiesMenu =
+cookieMonsterBys1tony.showCookiesMenu =
{
_popupset: null,
init: function()
{
// Retrieve original parent node for cookie monster menu
- this._popupset = document.getElementById("cookiemonster-menu").parentNode;
+ this._popupset = document.getElementById("cookiemonster-s1tony-menu").parentNode;
- // Set whether or not keyboard shortcut is enabled based on user's preference
- document.getElementById("cookiemonster-key").setAttribute("disabled", !s1tony.CM.nsPreferences.getBoolPref("enablekeyboardshortcut", true));
+ // Set whether or not keyboard shortcut is enabled based on user's preference
+ if (!cookieMonsterBys1tony.nsPreferences.getBoolPref("enablekeyboardshortcut", true))
+ {
+ document.getElementById("cookiemonster-s1tony-key").setAttribute("disabled", true);
+ }
},
onMenuItemCommand: function(evt)
@@ -147,16 +146,16 @@ s1tony.CM.showCookiesMenu =
{
// Make cookie monster menu item visible in context menu and add
// the cookie-access menu popup
- var menuItem = document.getElementById("cookiemonster-context");
- var cookieMenu = document.getElementById("cookiemonster-menu");
+ var menuItem = document.getElementById("cookiemonster-s1tony-context");
+ var cookieMenu = document.getElementById("cookiemonster-s1tony-menu");
// Only show the context menu if enablecontextmenu is set to true
- if (s1tony.CM.nsPreferences.getBoolPref("enablecontextmenu", false))
+ if (cookieMonsterBys1tony.nsPreferences.getBoolPref("enablecontextmenu", false))
{
if (evt.type == 'popupshown')
{
menuItem.hidden = false;
- menuItem.setAttribute("image", s1tony.CM.cookieMonsterButton.getIcon());
+ menuItem.setAttribute("image", cookieMonsterBys1tony.cookieMonsterButton.getIcon());
cookieMenu.setAttribute("position", "end_before");
menuItem.appendChild(cookieMenu);
}
@@ -172,10 +171,10 @@ s1tony.CM.showCookiesMenu =
onKeyboardShortcut: function(evt)
{
- if (evt.target.id == 'cookiemonster-key')
+ if (evt.target.id == 'cookiemonster-s1tony-key')
{
- // Check if cookiemonster-menu popup is showing and hide
- var cookieMenu = document.getElementById("cookiemonster-menu");
+ // Check if cookiemonster-s1tony-menu popup is showing and hide
+ var cookieMenu = document.getElementById("cookiemonster-s1tony-menu");
if (cookieMenu.state == 'open')
{
@@ -187,5 +186,5 @@ s1tony.CM.showCookiesMenu =
}
}
-//window.addEventListener("load", function(e) { s1tony.CM.showCookieExceptions.onLoad(e); },
+//window.addEventListener("load", function(e) { cookieMonsterBys1tony.showCookieExceptions.onLoad(e); },
//false);
diff --git a/chrome/cookiemonster.jar!/content/overlay.xul b/chrome/cookiemonster.jar!/content/overlay.xul
index d22b122..f907c77 100644
--- a/chrome/cookiemonster.jar!/content/overlay.xul
+++ b/chrome/cookiemonster.jar!/content/overlay.xul
@@ -2,7 +2,7 @@
<?xml-stylesheet href="chrome://cookiemonster/skin/overlay.css" type="text/css"?>
<!DOCTYPE overlay SYSTEM "chrome://cookiemonster/locale/overlay.dtd">
-<overlay id="cookieMonster-overlay"
+<overlay id="cookiemonster-s1tony-overlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script src="cookieMonster.js"/>
@@ -12,9 +12,9 @@
<script src="cookieInfo.js"/>
<script src="cookieTempAllow.js"/>
<script src="cookieRequest.js"/>
- <stringbundleset id="stringbundleset">
- <stringbundle id="cookie-preferences" src="chrome://browser/locale/preferences/preferences.properties"/>
- <stringbundle id="cookie-menu-labels" src="chrome://cookiemonster/locale/cookieMonster.properties"/>
+ <stringbundleset>
+ <stringbundle id="cookiemonster-s1tony-preferences" src="chrome://browser/locale/preferences/preferences.properties"/>
+ <stringbundle id="cookiemonster-s1tony-menu-labels" src="chrome://cookiemonster/locale/cookieMonster.properties"/>
</stringbundleset>
<!-- Status Bar -->
<statusbar id="status-bar">
@@ -23,94 +23,95 @@
</statusbarpanel>
<popupset>
<!-- Cookie Access Popup Menu from overlay -->
- <menupopup id="cookiemonster-menu" position="before_end" name="hidden" onpopupshowing="this.setAttribute('name', 'visible');" onpopuphidden="this.setAttribute('name', 'hidden');">
- <menu id="cookie-options-menu" label="&options;">
- <menupopup id="current-options">
- <menuitem id="option-second-level" label="&secondlevel;" type="checkbox"/>
- <menuitem id="show-global-override" label="&globaloverride;" disabled="true"
- oncommand="s1tony.CM.showOverrideGlobal.onMenuItemCommand(event);"/>
- <!-- <menu id="current-options-block-menu" label="&globalpermissions;">
- <menupopup id="current-options-block">
- <menuitem id="option-block-globally" label="&blockglobal;" type="checkbox"/>
- <menuitem id="option-block-thirdparty" label="&blockthirdparty;" type="checkbox"/>
+ <menupopup id="cookiemonster-s1tony-menu" position="before_end" name="hidden" onpopupshowing="this.setAttribute('name', 'visible');" onpopuphidden="this.setAttribute('name', 'hidden');">
+ <menu id="cookiemonster-s1tony-options-menu" label="&options;">
+ <menupopup id="cookiemonster-s1tony-current-options">
+ <menuitem id="cookiemonster-s1tony-option-second-level" label="&secondlevel;" type="checkbox"/>
+ <menuitem id="cookiemonster-s1tony-option-both-schemes" label="&bothhttpandhttps;" type="checkbox"/>
+ <menuitem id="cookiemonster-s1tony-show-global-override" label="&globaloverride;" disabled="true"
+ oncommand="cookieMonsterBys1tony.showOverrideGlobal.onMenuItemCommand(event);"/>
+ <!-- <menu id="cookiemonster-s1tony-current-options-block-menu" label="&globalpermissions;">
+ <menupopup id="cookiemonster-s1tony-current-options-block">
+ <menuitem id="cookiemonster-s1tony-option-block-globally" label="&blockglobal;" type="checkbox"/>
+ <menuitem id="cookiemonster-s1tony-option-block-thirdparty" label="&blockthirdparty;" type="checkbox"/>
</menupopup>
</menu> -->
</menupopup>
</menu>
- <menu id="cookie-view-menu" label="&viewcookies;">
- <menupopup id="view-cookies">
- <menuitem id="show-cookies-site" label="&showcookies;" name=""
- oncommand="s1tony.CM.showCookieExceptions.onMenuItemCommand(event);"/>
- <menuitem id="show-cookies" label="&showallcookies;"
- oncommand="s1tony.CM.showCookieExceptions.onMenuItemCommand(event);"/>
+ <menu id="cookiemonster-s1tony-view-menu" label="&viewcookies;">
+ <menupopup id="cookiemonster-s1tony-view-cookies">
+ <menuitem id="cookiemonster-s1tony-show-cookies-site" label="&showcookies;" name=""
+ oncommand="cookieMonsterBys1tony.showCookieExceptions.onMenuItemCommand(event);"/>
+ <menuitem id="cookiemonster-s1tony-show-cookies" label="&showallcookies;"
+ oncommand="cookieMonsterBys1tony.showCookieExceptions.onMenuItemCommand(event);"/>
<menuseparator/>
- <menuitem id="show-exceptions" label="&showcookieexceptions;"
- oncommand="s1tony.CM.showCookieExceptions.onMenuItemCommand(event);"/>
+ <menuitem id="cookiemonster-s1tony-show-exceptions" label="&showcookieexceptions;"
+ oncommand="cookieMonsterBys1tony.showCookieExceptions.onMenuItemCommand(event);"/>
<menuseparator/>
- <menuitem id="delete-cookies-site" label="&deletecookies;" name=""
- oncommand="s1tony.CM.deleteCookies.onMenuItemCommand(event);"/>
+ <menuitem id="cookiemonster-s1tony-delete-cookies-site" label="&deletecookies;" name=""
+ oncommand="cookieMonsterBys1tony.deleteCookies.onMenuItemCommand(event);"/>
</menupopup>
</menu>
- <menu id="cookie-thirdparty-menu" label="&thirdpartycookies;">
- <menupopup id="cookie-thirdparty-permissions">
- <menuitem id="cookie-thirdparty-default-none" label="&thirdpartydefault;" disabled="false" class="menuitem-iconic"/>
+ <menu id="cookiemonster-s1tony-thirdparty-menu" label="&thirdpartycookies;">
+ <menupopup id="cookiemonster-s1tony-thirdparty-permissions">
+ <menuitem id="cookiemonster-s1tony-thirdparty-default-none" label="&thirdpartydefault;" disabled="false" class="menuitem-iconic"/>
</menupopup>
</menu>
- <menu id="cookie-permissions-menu" label="¤tpermissions;">
- <menupopup id="current-permissions">
- <menuitem id="permissions-top" label="&sitepermissions;" class="menuitem-iconic"/>
- <menuitem id="permissions-second" label="&domainpermissions;" class="menuitem-iconic"/>
+ <menu id="cookiemonster-s1tony-permissions-menu" label="¤tpermissions;">
+ <menupopup id="cookiemonster-s1tony-current-permissions">
+ <menuitem id="cookiemonster-s1tony-permissions-top" label="&sitepermissions;" class="menuitem-iconic"/>
+ <menuitem id="cookiemonster-s1tony-permissions-second" label="&domainpermissions;" class="menuitem-iconic"/>
<menuseparator/>
- <menuitem id="permissions-result" label="&permissionsresult;" class="menuitem-iconic"/>
+ <menuitem id="cookiemonster-s1tony-permissions-result" label="&permissionsresult;" class="menuitem-iconic"/>
<!-- <menuseparator/>
- <menuitem id="option-override-global" label="&globaloverride;" type="checkbox"/> -->
+ <menuitem id="cookiemonster-s1tony-option-override-global" label="&globaloverride;" type="checkbox"/> -->
</menupopup>
</menu>
- <menu id="cookie-access-menu" label="&alternatecookieaccess;">
- <menupopup id="cookie-access-alternate">
- <menuitem id="cookie-access-second-temp" value="-1" label="&tempallow;" name="cookie-two" class="menuitem-iconic"/>
+ <menu id="cookiemonster-s1tony-access-menu" label="&alternatecookieaccess;">
+ <menupopup id="cookiemonster-s1tony-access-alternate">
+ <menuitem id="cookiemonster-s1tony-access-second-temp" value="-1" label="&tempallow;" name="cookie-two" class="menuitem-iconic"/>
<menuseparator/>
- <menuitem id="cookie-access-second-allow" value="1" label="&allow;" name="cookie-two" class="menuitem-iconic"/>
- <menuitem id="cookie-access-second-deny" value="2" label="&deny;" name="cookie-two" class="menuitem-iconic"/>
- <menuitem id="cookie-access-second-session" value="8" label="&session;" name="cookie-two" class="menuitem-iconic"/>
+ <menuitem id="cookiemonster-s1tony-access-second-allow" value="1" label="&allow;" name="cookie-two" class="menuitem-iconic"/>
+ <menuitem id="cookiemonster-s1tony-access-second-deny" value="2" label="&deny;" name="cookie-two" class="menuitem-iconic"/>
+ <menuitem id="cookiemonster-s1tony-access-second-session" value="8" label="&session;" name="cookie-two" class="menuitem-iconic"/>
</menupopup>
</menu>
<menuseparator/>
- <menuitem id="revoke-temp-permissions" label="&revoketempallow;" class="menuitem-iconic"
- oncommand="s1tony.CM.cookieMonster.extResetTempCookies();" />
+ <menuitem id="cookiemonster-s1tony-revoke-temp-permissions" label="&revoketempallow;" class="menuitem-iconic"
+ oncommand="cookieMonsterBys1tony.cookieMonster.extResetTempCookies();" />
<!-- <menuseparator/>
- <menuitem id="label-cookie-access" class="header" label="&cookieaccess;"/> -->
+ <menuitem id="cookiemonster-s1tony-label-cookie-access" class="header" label="&cookieaccess;"/> -->
<menuseparator/>
<menuseparator/>
- <menuitem id="cookie-access-default-default" value="0" label="&default;" name="current-access" class="menuitem-iconic"/>
- <menuseparator id="temp-after-this"/>
- <menuitem id="cookie-access-top-temp" value="-1" label="&tempallow;" name="cookie-top" class="menuitem-iconic"/>
- <menuseparator id="allow-after-this"/>
- <menuitem id="cookie-access-top-allow" value="1" label="&allow;" name="cookie-top" class="menuitem-iconic"/>
- <menuitem id="cookie-access-top-deny" value="2" label="&deny;" name="cookie-top" class="menuitem-iconic"/>
- <menuitem id="cookie-access-top-session" value="8" label="&session;" name="cookie-top" class="menuitem-iconic"/>
+ <menuitem id="cookiemonster-s1tony-access-default-default" value="0" label="&default;" name="current-access" class="menuitem-iconic"/>
+ <menuseparator id="cookiemonster-s1tony-temp-after-this"/>
+ <menuitem id="cookiemonster-s1tony-access-top-temp" value="-1" label="&tempallow;" name="cookie-top" class="menuitem-iconic"/>
+ <menuseparator id="cookiemonster-s1tony-allow-after-this"/>
+ <menuitem id="cookiemonster-s1tony-access-top-allow" value="1" label="&allow;" name="cookie-top" class="menuitem-iconic"/>
+ <menuitem id="cookiemonster-s1tony-access-top-deny" value="2" label="&deny;" name="cookie-top" class="menuitem-iconic"/>
+ <menuitem id="cookiemonster-s1tony-access-top-session" value="8" label="&session;" name="cookie-top" class="menuitem-iconic"/>
</menupopup>
- <tooltip id="cookie-results" orient="vertical" position="before_end" class="cookie-status-tooltip"
- onpopupshowing="s1tony.CM.cookieMonster.extSetSiteRequestedSetCookie(event); return (document.getElementById('cookiemonster-menu').getAttribute('name') == 'hidden');">
- <label id="cookie-status-header" value="¤tpermissions;"/>
+ <tooltip id="cookiemonster-s1tony-results" orient="vertical" position="before_end" class="cookie-status-tooltip"
+ onpopupshowing="cookieMonsterBys1tony.cookieMonster.extSetSiteRequestedSetCookie(event); return (document.getElementById('cookiemonster-s1tony-menu').getAttribute('name') == 'hidden');">
+ <label id="cookiemonster-s1tony-status-header" value="¤tpermissions;"/>
<vbox>
- <groupbox id="cookie-group-site" flex="1">
- <caption id="cookie-caption-site" label="&sitepermissions;" image="chrome://cookiemonster/skin/face-monkey-small.png"/>
- <description id="cookie-description-site" value="&default;"/>
+ <groupbox id="cookiemonster-s1tony-group-site" flex="1">
+ <caption id="cookiemonster-s1tony-caption-site" label="&sitepermissions;" image="chrome://cookiemonster/skin/face-monkey-small.png"/>
+ <description id="cookiemonster-s1tony-description-site" value="&default;"/>
</groupbox>
- <groupbox id="cookie-group-domain" flex="1">
- <caption id="cookie-caption-domain" label="&domainpermissions;" image="chrome://cookiemonster/skin/face-monkey-small.png"/>
- <description id="cookie-description-domain" value="&default;"/>
+ <groupbox id="cookiemonster-s1tony-group-domain" flex="1">
+ <caption id="cookiemonster-s1tony-caption-domain" label="&domainpermissions;" image="chrome://cookiemonster/skin/face-monkey-small.png"/>
+ <description id="cookiemonster-s1tony-description-domain" value="&default;"/>
</groupbox>
<separator class="groove"/>
- <groupbox id="cookie-group-result" flex="1">
- <caption id="cookie-caption-result" label="&permissionsresult;" image="chrome://cookiemonster/skin/face-monkey-small.png"/>
- <description id="cookie-description-result" value="&default;"/>
+ <groupbox id="cookiemonster-s1tony-group-result" flex="1">
+ <caption id="cookiemonster-s1tony-caption-result" label="&permissionsresult;" image="chrome://cookiemonster/skin/face-monkey-small.png"/>
+ <description id="cookiemonster-s1tony-description-result" value="&default;"/>
</groupbox>
<separator class="groove"/>
- <groupbox id="cookie-group-attempt" flex="1">
- <description id="cookie-description-attempt" value="&default;"/>
+ <groupbox id="cookiemonster-s1tony-group-attempt" flex="1">
+ <description id="cookiemonster-s1tony-description-attempt" value="&default;"/>
</groupbox>
</vbox>
</tooltip>
@@ -118,15 +119,15 @@
</statusbar>
<!-- Firefox Context Menu -->
- <popup id="contentAreaContextMenu" onpopupshown="s1tony.CM.showCookiesMenu.onMenuItemCommand(event);"
- onpopuphidden="s1tony.CM.showCookiesMenu.onMenuItemCommand(event);">
- <menu id="cookiemonster-context" label="&cookiemonster;" hidden="true" class="menu-iconic">
- </menu>
+ <popup id="contentAreaContextMenu" onpopupshown="cookieMonsterBys1tony.showCookiesMenu.onMenuItemCommand(event);"
+ onpopuphidden="cookieMonsterBys1tony.showCookiesMenu.onMenuItemCommand(event);">
+ <menu id="cookiemonster-s1tony-context" label="&cookiemonster;" hidden="true" class="menu-iconic">
+ </menu>
</popup>
<!-- Shortcut Keys to Menu -->
<keyset>
- <key id="cookiemonster-key" modifiers="control alt" key="c" oncommand="s1tony.CM.showCookiesMenu.onKeyboardShortcut(event);"/>
+ <key id="cookiemonster-s1tony-key" modifiers="control,alt" key="m" oncommand="cookieMonsterBys1tony.showCookiesMenu.onKeyboardShortcut(event);"/>
</keyset>
</overlay>
diff --git a/chrome/cookiemonster.jar!/content/overlay_toolbar.xul b/chrome/cookiemonster.jar!/content/overlay_toolbar.xul
index b7b66c7..2fd4d4a 100644
--- a/chrome/cookiemonster.jar!/content/overlay_toolbar.xul
+++ b/chrome/cookiemonster.jar!/content/overlay_toolbar.xul
@@ -2,7 +2,7 @@
<?xml-stylesheet href="chrome://cookiemonster/skin/overlay.css" type="text/css"?>
<!DOCTYPE overlay SYSTEM "chrome://cookiemonster/locale/overlay.dtd">
-<overlay id="cookieMonster-overlay"
+<overlay id="cookiemonster-s1tony-overlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script src="cookieMonster.js"/>
@@ -12,15 +12,15 @@
<script src="cookieInfo.js"/>
<script src="cookieTempAllow.js"/>
<script src="cookieRequest.js"/>
- <stringbundleset id="stringbundleset">
- <stringbundle id="cookie-preferences" src="chrome://browser/locale/preferences/preferences.properties"/>
- <stringbundle id="cookie-menu-labels" src="chrome://cookiemonster/locale/cookieMonster.properties"/>
+ <stringbundleset>
+ <stringbundle id="cookiemonster-s1tony-preferences" src="chrome://browser/locale/preferences/preferences.properties"/>
+ <stringbundle id="cookiemonster-s1tony-menu-labels" src="chrome://cookiemonster/locale/cookieMonster.properties"/>
</stringbundleset>
<!-- Tool Bar -->
<toolbarpalette id="BrowserToolbarPalette">
<toolbarbutton id="cookiemonster-status"
- class="toolbarbutton-1"
+ class="toolbarbutton-1"
tooltiptext="&cookiemonsterdescription;"
label="&cookiemonster;"
image="chrome://cookiemonster/skin/cookie-monster-logo.png">
@@ -28,96 +28,97 @@
</toolbarpalette>
<popupset> <!-- id="cookieMonster-popupset" -->
<!-- Cookie Access Popup Menu from overlay id="cookie-access" -->
- <menupopup id="cookiemonster-menu" position="before_end" name="hidden" onpopupshowing="this.setAttribute('name', 'visible');" onpopuphidden="this.setAttribute('name', 'hidden');">
- <menu id="cookie-options-menu" label="&options;">
- <menupopup id="current-options">
- <menuitem id="option-second-level" label="&secondlevel;" type="checkbox"/>
- <menuitem id="show-global-override" label="&globaloverride;" disabled="true"
- oncommand="s1tony.CM.showOverrideGlobal.onMenuItemCommand(event);"/>
+ <menupopup id="cookiemonster-s1tony-menu" position="before_end" name="hidden" onpopupshowing="this.setAttribute('name', 'visible');" onpopuphidden="this.setAttribute('name', 'hidden');">
+ <menu id="cookiemonster-s1tony-options-menu" label="&options;">
+ <menupopup id="cookiemonster-s1tony-current-options">
+ <menuitem id="cookiemonster-s1tony-option-second-level" label="&secondlevel;" type="checkbox"/>
+ <menuitem id="cookiemonster-s1tony-option-both-schemes" label="&bothhttpandhttps;" type="checkbox"/>
+ <menuitem id="cookiemonster-s1tony-show-global-override" label="&globaloverride;" disabled="true"
+ oncommand="cookieMonsterBys1tony.showOverrideGlobal.onMenuItemCommand(event);"/>
</menupopup>
</menu>
- <menu id="cookie-view-menu" label="&viewcookies;">
- <menupopup id="view-cookies">
- <menuitem id="show-cookies-site" label="&showcookies;" name=""
- oncommand="s1tony.CM.showCookieExceptions.onMenuItemCommand(event);"/>
- <menuitem id="show-cookies" label="&showallcookies;"
- oncommand="s1tony.CM.showCookieExceptions.onMenuItemCommand(event);"/>
+ <menu id="cookiemonster-s1tony-view-menu" label="&viewcookies;">
+ <menupopup id="cookiemonster-s1tony-view-cookies">
+ <menuitem id="cookiemonster-s1tony-show-cookies-site" label="&showcookies;" name=""
+ oncommand="cookieMonsterBys1tony.showCookieExceptions.onMenuItemCommand(event);"/>
+ <menuitem id="cookiemonster-s1tony-show-cookies" label="&showallcookies;"
+ oncommand="cookieMonsterBys1tony.showCookieExceptions.onMenuItemCommand(event);"/>
<menuseparator/>
- <menuitem id="show-exceptions" label="&showcookieexceptions;"
- oncommand="s1tony.CM.showCookieExceptions.onMenuItemCommand(event);"/>
+ <menuitem id="cookiemonster-s1tony-show-exceptions" label="&showcookieexceptions;"
+ oncommand="cookieMonsterBys1tony.showCookieExceptions.onMenuItemCommand(event);"/>
<menuseparator/>
- <menuitem id="delete-cookies-site" label="&deletecookies;" name=""
- oncommand="s1tony.CM.deleteCookies.onMenuItemCommand(event);"/>
+ <menuitem id="cookiemonster-s1tony-delete-cookies-site" label="&deletecookies;" name=""
+ oncommand="cookieMonsterBys1tony.deleteCookies.onMenuItemCommand(event);"/>
</menupopup>
</menu>
- <menu id="cookie-thirdparty-menu" label="&thirdpartycookies;">
- <menupopup id="cookie-thirdparty-permissions">
- <menuitem id="cookie-thirdparty-default-none" label="&thirdpartydefault;" disabled="false" class="menuitem-iconic"/>
+ <menu id="cookiemonster-s1tony-thirdparty-menu" label="&thirdpartycookies;">
+ <menupopup id="cookiemonster-s1tony-thirdparty-permissions">
+ <menuitem id="cookiemonster-s1tony-thirdparty-default-none" label="&thirdpartydefault;" disabled="false" class="menuitem-iconic"/>
</menupopup>
</menu>
- <menu id="cookie-permissions-menu" label="¤tpermissions;">
- <menupopup id="current-permissions">
- <menuitem id="permissions-top" label="&sitepermissions;" class="menuitem-iconic"/>
- <menuitem id="permissions-second" label="&domainpermissions;" class="menuitem-iconic"/>
+ <menu id="cookiemonster-s1tony-permissions-menu" label="¤tpermissions;">
+ <menupopup id="cookiemonster-s1tony-current-permissions">
+ <menuitem id="cookiemonster-s1tony-permissions-top" label="&sitepermissions;" class="menuitem-iconic"/>
+ <menuitem id="cookiemonster-s1tony-permissions-second" label="&domainpermissions;" class="menuitem-iconic"/>
<menuseparator/>
- <menuitem id="permissions-result" label="&permissionsresult;" class="menuitem-iconic"/>
+ <menuitem id="cookiemonster-s1tony-permissions-result" label="&permissionsresult;" class="menuitem-iconic"/>
</menupopup>
</menu>
- <menu id="cookie-access-menu" label="&alternatecookieaccess;">
- <menupopup id="cookie-access-alternate">
- <menuitem id="cookie-access-second-temp" value="-1" label="&tempallow;" name="cookie-two" class="menuitem-iconic"/>
+ <menu id="cookiemonster-s1tony-access-menu" label="&alternatecookieaccess;">
+ <menupopup id="cookiemonster-s1tony-access-alternate">
+ <menuitem id="cookiemonster-s1tony-access-second-temp" value="-1" label="&tempallow;" name="cookie-two" class="menuitem-iconic"/>
<menuseparator/>
- <menuitem id="cookie-access-second-allow" value="1" label="&allow;" name="cookie-two" class="menuitem-iconic"/>
- <menuitem id="cookie-access-second-deny" value="2" label="&deny;" name="cookie-two" class="menuitem-iconic"/>
- <menuitem id="cookie-access-second-session" value="8" label="&session;" name="cookie-two" class="menuitem-iconic"/>
+ <menuitem id="cookiemonster-s1tony-access-second-allow" value="1" label="&allow;" name="cookie-two" class="menuitem-iconic"/>
+ <menuitem id="cookiemonster-s1tony-access-second-deny" value="2" label="&deny;" name="cookie-two" class="menuitem-iconic"/>
+ <menuitem id="cookiemonster-s1tony-access-second-session" value="8" label="&session;" name="cookie-two" class="menuitem-iconic"/>
</menupopup>
</menu>
<menuseparator/>
- <menuitem id="revoke-temp-permissions" label="&revoketempallow;" class="menuitem-iconic"
- oncommand="s1tony.CM.cookieMonster.extResetTempCookies();" />
+ <menuitem id="cookiemonster-s1tony-revoke-temp-permissions" label="&revoketempallow;" class="menuitem-iconic"
+ oncommand="cookieMonsterBys1tony.cookieMonster.extResetTempCookies();" />
<menuseparator/>
- <menuitem id="cookie-access-default-default" value="0" label="&default;" name="current-access" class="menuitem-iconic"/>
- <menuseparator id="temp-after-this"/>
- <menuitem id="cookie-access-top-temp" value="-1" label="&tempallow;" name="cookie-top" class="menuitem-iconic"/>
- <menuseparator id="allow-after-this"/>
- <menuitem id="cookie-access-top-allow" value="1" label="&allow;" name="cookie-top" class="menuitem-iconic"/>
- <menuitem id="cookie-access-top-deny" value="2" label="&deny;" name="cookie-top" class="menuitem-iconic"/>
- <menuitem id="cookie-access-top-session" value="8" label="&session;" name="cookie-top" class="menuitem-iconic"/>
+ <menuitem id="cookiemonster-s1tony-access-default-default" value="0" label="&default;" name="current-access" class="menuitem-iconic"/>
+ <menuseparator id="cookiemonster-s1tony-temp-after-this"/>
+ <menuitem id="cookiemonster-s1tony-access-top-temp" value="-1" label="&tempallow;" name="cookie-top" class="menuitem-iconic"/>
+ <menuseparator id="cookiemonster-s1tony-allow-after-this"/>
+ <menuitem id="cookiemonster-s1tony-access-top-allow" value="1" label="&allow;" name="cookie-top" class="menuitem-iconic"/>
+ <menuitem id="cookiemonster-s1tony-access-top-deny" value="2" label="&deny;" name="cookie-top" class="menuitem-iconic"/>
+ <menuitem id="cookiemonster-s1tony-access-top-session" value="8" label="&session;" name="cookie-top" class="menuitem-iconic"/>
</menupopup>
- <tooltip id="cookie-results" orient="vertical" position="before_end" class="cookie-status-tooltip"
- onpopupshowing="s1tony.CM.cookieMonster.extSetSiteRequestedSetCookie(event); return (document.getElementById('cookiemonster-menu').getAttribute('name') == 'hidden');">
- <label id="cookie-status-header" value="¤tpermissions;"/>
+ <tooltip id="cookiemonster-s1tony-results" orient="vertical" position="before_end" class="cookie-status-tooltip"
+ onpopupshowing="cookieMonsterBys1tony.cookieMonster.extSetSiteRequestedSetCookie(event); return (document.getElementById('cookiemonster-s1tony-menu').getAttribute('name') == 'hidden');">
+ <label id="cookiemonster-s1tony-status-header" value="¤tpermissions;"/>
<vbox>
- <groupbox id="cookie-group-site" flex="1">
- <caption id="cookie-caption-site" label="&sitepermissions;" image="chrome://cookiemonster/skin/face-monkey-small.png"/>
- <description id="cookie-description-site" value="&default;"/>
+ <groupbox id="cookiemonster-s1tony-group-site" flex="1">
+ <caption id="cookiemonster-s1tony-caption-site" label="&sitepermissions;" image="chrome://cookiemonster/skin/face-monkey-small.png"/>
+ <description id="cookiemonster-s1tony-description-site" value="&default;"/>
</groupbox>
- <groupbox id="cookie-group-domain" flex="1">
- <caption id="cookie-caption-domain" label="&domainpermissions;" image="chrome://cookiemonster/skin/face-monkey-small.png"/>
- <description id="cookie-description-domain" value="&default;"/>
+ <groupbox id="cookiemonster-s1tony-group-domain" flex="1">
+ <caption id="cookiemonster-s1tony-caption-domain" label="&domainpermissions;" image="chrome://cookiemonster/skin/face-monkey-small.png"/>
+ <description id="cookiemonster-s1tony-description-domain" value="&default;"/>
</groupbox>
<separator class="groove"/>
- <groupbox id="cookie-group-result" flex="1">
- <caption id="cookie-caption-result" label="&permissionsresult;" image="chrome://cookiemonster/skin/face-monkey-small.png"/>
- <description id="cookie-description-result" value="&default;"/>
+ <groupbox id="cookiemonster-s1tony-group-result" flex="1">
+ <caption id="cookiemonster-s1tony-caption-result" label="&permissionsresult;" image="chrome://cookiemonster/skin/face-monkey-small.png"/>
+ <description id="cookiemonster-s1tony-description-result" value="&default;"/>
</groupbox>
<separator class="groove"/>
- <groupbox id="cookie-group-attempt" flex="1">
- <description id="cookie-description-attempt" value="&default;"/>
+ <groupbox id="cookiemonster-s1tony-group-attempt" flex="1">
+ <description id="cookiemonster-s1tony-description-attempt" value="&default;"/>
</groupbox>
</vbox>
</tooltip>
</popupset>
<!-- Firefox Context Menu -->
- <popup id="contentAreaContextMenu" onpopupshown="s1tony.CM.showCookiesMenu.onMenuItemCommand(event);"
- onpopuphidden="s1tony.CM.showCookiesMenu.onMenuItemCommand(event);">
- <menu id="cookiemonster-context" label="&cookiemonster;" hidden="true" class="menu-iconic" />
+ <popup id="contentAreaContextMenu" onpopupshown="cookieMonsterBys1tony.showCookiesMenu.onMenuItemCommand(event);"
+ onpopuphidden="cookieMonsterBys1tony.showCookiesMenu.onMenuItemCommand(event);">
+ <menu id="cookiemonster-s1tony-context" label="&cookiemonster;" hidden="true" class="menu-iconic" />
</popup>
<!-- Shortcut Keys to Menu -->
<keyset>
- <key id="cookiemonster-key" modifiers="accel alt" key="c" oncommand="s1tony.CM.showCookiesMenu.onKeyboardShortcut(event);"/>
+ <key id="cookiemonster-s1tony-key" modifiers="control,alt" key="m" oncommand="cookieMonsterBys1tony.showCookiesMenu.onKeyboardShortcut(event);"/>
</keyset>
</overlay>
diff --git a/chrome/cookiemonster.jar!/content/siteCookies.xul b/chrome/cookiemonster.jar!/content/siteCookies.xul
index 919a993..686d082 100644
--- a/chrome/cookiemonster.jar!/content/siteCookies.xul
+++ b/chrome/cookiemonster.jar!/content/siteCookies.xul
@@ -102,8 +102,8 @@
<button id="removeSelectedCookies" disabled="true" icon="clear"
accesskey="&button.removeSelectedCookies.accesskey;"
oncommand="gSiteCookiesWindow.deleteCookie();"/>
- <button id="removeAllCookies" disabled="true" icon="clear"
- label="&button.removeAllCookies.label;" accesskey="&button.removeAllCookies.accesskey;"
+ <button id="removeAllCookies" disabled="true" icon="clear"
+ label="&button.removeAllCookies.label;" accesskey="&button.removeAllCookies.accesskey;"
oncommand="gSiteCookiesWindow.deleteAllCookies();"/>
<spacer flex="1"/>
<button oncommand="close();" icon="close"
diff --git a/chrome/cookiemonster.jar!/locale/de-DE/options.dtd b/chrome/cookiemonster.jar!/locale/de-DE/options.dtd
index 73c0f67..c192aef 100644
--- a/chrome/cookiemonster.jar!/locale/de-DE/options.dtd
+++ b/chrome/cookiemonster.jar!/locale/de-DE/options.dtd
@@ -2,9 +2,10 @@
<!ENTITY cookiemonster "Hallo Cookies!">
<!ENTITY options "Einstellungen">
<!ENTITY secondlevel "2nd Level Domain Namen verwenden">
+<!ENTITY bothhttpandhttps "Cookie-Einstellungen auf HTTP und HTTPS anwenden">
<!ENTITY reloadonpermissionchange "Betroffene Seite automatisch bei Änderung der Cookie-Berechtigung neu laden">
<!ENTITY enablecontextmenu "Kontextmenüeintrag für Cookie Monster anzeigen">
-<!ENTITY enablekeyboardshortcut "Aktivieren Sie Tastaturkürzel (Ctrl Alt C)">
+<!ENTITY enablekeyboardshortcut "Aktivieren Sie Tastaturkürzel (Ctrl + Alt + M)">
<!ENTITY deletecookies "Cookies beim Autorisierungswechsel nach verweigert löschen">
<!ENTITY enableglobalcookies "Überschreiben der globalen Cookieautorisierung aktivieren">
<!ENTITY thirdPartyCookies "3rd Party Cookies blockieren">
diff --git a/chrome/cookiemonster.jar!/locale/de-DE/overlay.dtd b/chrome/cookiemonster.jar!/locale/de-DE/overlay.dtd
index 9d25395..c488dfb 100644
--- a/chrome/cookiemonster.jar!/locale/de-DE/overlay.dtd
+++ b/chrome/cookiemonster.jar!/locale/de-DE/overlay.dtd
@@ -1,6 +1,7 @@
<!ENTITY helloworld "Hallo Welt!">
<!ENTITY cookiemonster "Hallo Cookies!">
<!ENTITY secondlevel "2nd Level Domain Namen verwenden">
+<!ENTITY bothhttpandhttps "Cookie-Einstellungen auf HTTP und HTTPS anwenden">
<!ENTITY globalpermissions "Globale Cookie-Einstellungen">
<!ENTITY blockglobal "Alle Cookies verweigern (Abwählen zum erlauben)">
<!ENTITY blockthirdparty "Nur 3rd Party Cookies verweigern">
diff --git a/chrome/cookiemonster.jar!/locale/en-US/options.dtd b/chrome/cookiemonster.jar!/locale/en-US/options.dtd
index f115213..bc60181 100644
--- a/chrome/cookiemonster.jar!/locale/en-US/options.dtd
+++ b/chrome/cookiemonster.jar!/locale/en-US/options.dtd
@@ -2,9 +2,10 @@
<!ENTITY cookiemonster "Hello Cookies!">
<!ENTITY options "Options">
<!ENTITY secondlevel "Use 2nd Level Domain Names">
+<!ENTITY bothhttpandhttps "Apply Cookie Settings to both HTTP and HTTPS">
<!ENTITY reloadonpermissionchange "Automatically Reload Affected Page When Cookie Permissions Change">
<!ENTITY enablecontextmenu "Display Cookie Monster Menu in Context Menu">
-<!ENTITY enablekeyboardshortcut "Enable keyboard shortcut (Ctrl Alt C)">
+<!ENTITY enablekeyboardshortcut "Enable keyboard shortcut (Ctrl + Alt + M)">
<!ENTITY deletecookies "Delete Cookies When Changing access to Deny">
<!ENTITY enableglobalcookies "Enable Global Cookie Permissions Override">
<!ENTITY thirdPartyCookies "Block 3rd Party Cookies">
diff --git a/chrome/cookiemonster.jar!/locale/en-US/overlay.dtd b/chrome/cookiemonster.jar!/locale/en-US/overlay.dtd
index a957727..a8e10ea 100644
--- a/chrome/cookiemonster.jar!/locale/en-US/overlay.dtd
+++ b/chrome/cookiemonster.jar!/locale/en-US/overlay.dtd
@@ -1,6 +1,7 @@
<!ENTITY helloworld "Hello World!">
<!ENTITY cookiemonster "Cookie Monster">
<!ENTITY secondlevel "Use 2nd Level Domain Names">
+<!ENTITY bothhttpandhttps "Apply Cookie Settings to both HTTP and HTTPS">
<!ENTITY globalpermissions "Global Cookie Settings">
<!ENTITY blockglobal "Block All Cookies (Uncheck to Allow)">
<!ENTITY blockthirdparty "Block 3rd Party Cookies Only">
diff --git a/chrome/cookiemonster.jar!/locale/fr-FR/options.dtd b/chrome/cookiemonster.jar!/locale/fr-FR/options.dtd
index 21c046c..3998e53 100644
--- a/chrome/cookiemonster.jar!/locale/fr-FR/options.dtd
+++ b/chrome/cookiemonster.jar!/locale/fr-FR/options.dtd
@@ -2,9 +2,10 @@
<!ENTITY cookiemonster "Bonjour Cookies!">
<!ENTITY options "Options">
<!ENTITY secondlevel "Appliquer les même permissions sur l'ensemble du nom de domaine">
+<!ENTITY bothhttpandhttps "Appliquer les paramètres de cookie à la fois HTTP et HTTPS">
<!ENTITY reloadonpermissionchange "Recharger automatiquement les pages affectées après un changement de permission">
<!ENTITY enablecontextmenu "Afficher Cookie Monster dans le menu contextuel">
-<!ENTITY enablekeyboardshortcut "Activer raccourci clavier (Ctrl Alt C)">
+<!ENTITY enablekeyboardshortcut "Activer raccourci clavier (Ctrl + Alt + M)">
<!ENTITY deletecookies "Supprimer les cookies lors du passage à l'état 'interdire'">
<!ENTITY enableglobalcookies "Autoriser d'outre-passer les permissions par défaut">
<!ENTITY thirdPartyCookies "Bloquer les cookies tiers">
diff --git a/chrome/cookiemonster.jar!/locale/fr-FR/overlay.dtd b/chrome/cookiemonster.jar!/locale/fr-FR/overlay.dtd
index 7e6abdf..9bf1e2b 100644
--- a/chrome/cookiemonster.jar!/locale/fr-FR/overlay.dtd
+++ b/chrome/cookiemonster.jar!/locale/fr-FR/overlay.dtd
@@ -1,6 +1,7 @@
<!ENTITY helloworld "Hello World!">
<!ENTITY cookiemonster "Bonjour Cookies!">
<!ENTITY secondlevel "Appliquer les même permissions sur l'ensemble du nom de domaine">
+<!ENTITY bothhttpandhttps "Appliquer les paramètres de cookie à la fois HTTP et HTTPS">
<!ENTITY globalpermissions "Paramètres globals des cookies">
<!ENTITY blockglobal "Bloquer tous les cookies (Décocher pour autoriser)">
<!ENTITY blockthirdparty "Bloque les cookies tiers seulement">
diff --git a/chrome/cookiemonster.jar!/locale/it-IT/options.dtd b/chrome/cookiemonster.jar!/locale/it-IT/options.dtd
index c2b68d8..ebf0e50 100644
--- a/chrome/cookiemonster.jar!/locale/it-IT/options.dtd
+++ b/chrome/cookiemonster.jar!/locale/it-IT/options.dtd
@@ -2,9 +2,10 @@
<!ENTITY cookiemonster "Ciao cookie!">
<!ENTITY options "Opzioni">
<!ENTITY secondlevel "Utilizza i nomi di dominio di 2° livello">
+<!ENTITY bothhttpandhttps "Applica impostazioni cookie HTTP e HTTPS">
<!ENTITY reloadonpermissionchange "Ricarica automaticamente la pagina quando cambiano i permessi dei cookie">
<!ENTITY enablecontextmenu "Visualizza la voce Cookie Monster nel menu contestuale">
-<!ENTITY enablekeyboardshortcut "Attiva scorciatoia da tastiera (Ctrl Alt C)">
+<!ENTITY enablekeyboardshortcut "Attiva scorciatoia da tastiera (Ctrl + Alt + M)">
<!ENTITY deletecookies "Elimina i cookie quando si imposta un blocco">
<!ENTITY enableglobalcookies "Attiva sostituzione globale dei permessi sui cookie">
<!ENTITY thirdPartyCookies "Blocca cookie di terze parti">
diff --git a/chrome/cookiemonster.jar!/locale/it-IT/overlay.dtd b/chrome/cookiemonster.jar!/locale/it-IT/overlay.dtd
index 40dfddf..4b2c7d3 100644
--- a/chrome/cookiemonster.jar!/locale/it-IT/overlay.dtd
+++ b/chrome/cookiemonster.jar!/locale/it-IT/overlay.dtd
@@ -1,6 +1,7 @@
<!ENTITY helloworld "Ciao Mondo!">
<!ENTITY cookiemonster "Cookie Monster">
<!ENTITY secondlevel "Utilizza i nomi di dominio di 2° livello">
+<!ENTITY bothhttpandhttps "Applica impostazioni cookie HTTP e HTTPS">
<!ENTITY globalpermissions "Impostazioni globali per i cookie">
<!ENTITY blockglobal "Blocca tutti i cookie (deselezionare per accettare)">
<!ENTITY blockthirdparty "Blocca solo cookie di terze parti">
diff --git a/chrome/cookiemonster.jar!/locale/nl-NL/options.dtd b/chrome/cookiemonster.jar!/locale/nl-NL/options.dtd
index 3b3481e..b104fb1 100644
--- a/chrome/cookiemonster.jar!/locale/nl-NL/options.dtd
+++ b/chrome/cookiemonster.jar!/locale/nl-NL/options.dtd
@@ -2,9 +2,10 @@
<!ENTITY cookiemonster "Hallo Cookies!">
<!ENTITY options "Opties">
<!ENTITY secondlevel "Gebruik 2e niveau domeinnamen">
+<!ENTITY bothhttpandhttps "Solliciteer Cookie Instellingen om zowel HTTP- en HTTPS">
<!ENTITY reloadonpermissionchange "Automatisch betreffende pagina herladen, wanneer Cookie permissies worden gewijzigd">
<!ENTITY enablecontextmenu "Cookie Monster menu in context menu tonen">
-<!ENTITY enablekeyboardshortcut "Sneltoets inschakelen (Ctrl Alt C)">
+<!ENTITY enablekeyboardshortcut "Sneltoets inschakelen (Ctrl + Alt + M)">
<!ENTITY deletecookies "Verwijder Cookies wanneer de toegang wordt gewijzigd naar geblokkeerd">
<!ENTITY enableglobalcookies "Activeer omzeilen globale Cookie permissies">
<!ENTITY thirdPartyCookies "Blokkeer 3e partij Cookies">
diff --git a/chrome/cookiemonster.jar!/locale/nl-NL/overlay.dtd b/chrome/cookiemonster.jar!/locale/nl-NL/overlay.dtd
index 7c26ba6..d42877d 100644
--- a/chrome/cookiemonster.jar!/locale/nl-NL/overlay.dtd
+++ b/chrome/cookiemonster.jar!/locale/nl-NL/overlay.dtd
@@ -1,6 +1,7 @@
<!ENTITY helloworld "Hallo Wereld!">
<!ENTITY cookiemonster "Cookie Monster">
<!ENTITY secondlevel "Gebruik 2e niveau domeinnamen">
+<!ENTITY bothhttpandhttps "Solliciteer Cookie Instellingen om zowel HTTP- en HTTPS">
<!ENTITY globalpermissions "Globale Cookie instellingen">
<!ENTITY blockglobal "Blokkeer alle Cookies (uitvinken om toe te staan)">
<!ENTITY blockthirdparty "Blokkeer alleen 3e partij Cookies">
diff --git a/chrome/cookiemonster.jar!/locale/ru-RU/options.dtd b/chrome/cookiemonster.jar!/locale/ru-RU/options.dtd
index 575d782..2fbaf9d 100644
--- a/chrome/cookiemonster.jar!/locale/ru-RU/options.dtd
+++ b/chrome/cookiemonster.jar!/locale/ru-RU/options.dtd
@@ -2,9 +2,10 @@
<!ENTITY cookiemonster "Hello Cookies!">
<!ENTITY options "Параметры">
<!ENTITY secondlevel "Использовать имена доменов второго уровня">
+<!ENTITY bothhttpandhttps "Нанесите cookie-файл настройки для HTTP и HTTPS">
<!ENTITY reloadonpermissionchange "Автоматически перезагружать страницу после изменений разрешений куки">
<!ENTITY enablecontextmenu "Показывать меню настроек Cookie Monster в контекстном меню">
-<!ENTITY enablekeyboardshortcut "Включить комбинации клавиш на клавиатуре(Ctrl Alt C)">
+<!ENTITY enablekeyboardshortcut "Включить комбинации клавиш на клавиатуре(Ctrl + Alt + M)">
<!ENTITY deletecookies "Удалить куки при изменении доступа на Запретить">
<!ENTITY enableglobalcookies "Включить переопределение глобальных разрешений куки">
<!ENTITY thirdPartyCookies "Блокировать сторонние куки">
diff --git a/chrome/cookiemonster.jar!/locale/ru-RU/overlay.dtd b/chrome/cookiemonster.jar!/locale/ru-RU/overlay.dtd
index be246ce..fcf948e 100644
--- a/chrome/cookiemonster.jar!/locale/ru-RU/overlay.dtd
+++ b/chrome/cookiemonster.jar!/locale/ru-RU/overlay.dtd
@@ -1,6 +1,7 @@
<!ENTITY helloworld "Hello World!">
<!ENTITY cookiemonster "Cookie Monster">
<!ENTITY secondlevel "Использовать имена доменов второго уровня">
+<!ENTITY bothhttpandhttps "Нанесите cookie-файл настройки для HTTP и HTTPS">
<!ENTITY globalpermissions "Глобальные параметры куки">
<!ENTITY blockglobal "Блокировать все куки (снимите чтобы разрешить)">
<!ENTITY blockthirdparty "Блокировать только сторонние куки">
diff --git a/chrome/cookiemonster.jar!/locale/zh-CN/cookieMonster.dtd b/chrome/cookiemonster.jar!/locale/zh-CN/cookieMonster.dtd
new file mode 100644
index 0000000..fbb9c8d
--- /dev/null
+++ b/chrome/cookiemonster.jar!/locale/zh-CN/cookieMonster.dtd
@@ -0,0 +1,3 @@
+<!ENTITY title.label "Hello World">
+<!ENTITY separate.label "这是一个独立的窗口!">
+<!ENTITY close.label "关闭">
diff --git a/chrome/cookiemonster.jar!/locale/zh-CN/cookieMonster.properties b/chrome/cookiemonster.jar!/locale/zh-CN/cookieMonster.properties
new file mode 100644
index 0000000..249b968
--- /dev/null
+++ b/chrome/cookiemonster.jar!/locale/zh-CN/cookieMonster.properties
@@ -0,0 +1,41 @@
+#### Cookie Access for Menu
+
+default=默认动作
+accepted=接受
+userprompted=提示用户
+acceptedsession=会话接受
+rejected=拒绝
+originatingsiteonly=仅原始网站
+allow=接受Cookies来自
+deny=阻止Cookies来自
+session=接受会话Cookies来自
+tooltiptext=Cookie访问来自
+temp=临时允许Cookies来自
+sitepermissions=网站
+domainpermissions=域名
+permissionsresult=设定动作
+permissionsresultfor=设定动作来自
+showcurrentcookies=显示Cookies来自
+deletecurrentcookies=删除Cookies来自
+Default=默认
+Allow=允许
+Session=允许会话
+Deny=阻止
+Temp=临时允许
+alternatecookieaccess=Cookie访问
+sitemenulabel=网站层次
+domainmenulabel=域名层次
+thirdpartyblocked=阻止第三方
+
+## Labels for Confirmation Dialog
+confirmtitle=删除Cookies
+confirmtext=您确定要删除 %S 的Cookies?
+
+## Labels for Third Party Menu
+thirdpartynone=未检测到
+thirdpartytempallowall=临时允许所有
+thirdpartytemprevokeall=取消临时允许
+
+## Label for Site Requesting to Set Cookie Indicator
+siteattemptedcookie=该网站请求设置Cookie(s)
+sitenotattemptedcookie=该网站未请求设置Cookie(s)
diff --git a/chrome/cookiemonster.jar!/locale/zh-CN/options.dtd b/chrome/cookiemonster.jar!/locale/zh-CN/options.dtd
new file mode 100644
index 0000000..6c2abaf
--- /dev/null
+++ b/chrome/cookiemonster.jar!/locale/zh-CN/options.dtd
@@ -0,0 +1,14 @@
+<!ENTITY options_window_title "Cookie Monster 选项">
+<!ENTITY cookiemonster "Hello Cookies!">
+<!ENTITY options "选项">
+<!ENTITY secondlevel "使用二级域名">
+<!ENTITY bothhttpandhttps "应用Cookie设置到HTTP与HTTPS">
+<!ENTITY reloadonpermissionchange "权限变化时自动刷新受影响页面">
+<!ENTITY enablecontextmenu "在页面右键菜单中显示Cookie Monster">
+<!ENTITY enablekeyboardshortcut "启用快捷键(Ctrl + Alt + M)">
+<!ENTITY deletecookies "更改权限为拒绝时删除Cookies">
+<!ENTITY enableglobalcookies "启用全局Cookies权限覆盖">
+<!ENTITY thirdPartyCookies "阻止第三方Cookies">
+<!ENTITY denyCookiesDefault "阻止所有Cookies">
+<!ENTITY disabledeletecookieconfirm "禁用删除Cookies菜单的确认对话框">
+<!ENTITY originaldefaulticon "使用原始默认图标(猴子)">
diff --git a/chrome/cookiemonster.jar!/locale/zh-CN/overlay.dtd b/chrome/cookiemonster.jar!/locale/zh-CN/overlay.dtd
new file mode 100644
index 0000000..7186ccf
--- /dev/null
+++ b/chrome/cookiemonster.jar!/locale/zh-CN/overlay.dtd
@@ -0,0 +1,28 @@
+<!ENTITY helloworld "Hello World!">
+<!ENTITY cookiemonster "Cookie Monster">
+<!ENTITY secondlevel "使用二级域名">
+<!ENTITY bothhttpandhttps "应用Cookie设置到HTTP与HTTPS">
+<!ENTITY globalpermissions "全局Cookie设置">
+<!ENTITY blockglobal "阻止所有Cookies (不选中为允许)">
+<!ENTITY blockthirdparty "只阻止第三方Cookies">
+<!ENTITY globaloverride "覆盖全局Cookies权限">
+<!ENTITY showcookieexceptions "显示Cookie例外">
+<!ENTITY showcookies "显示Cookies">
+<!ENTITY showallcookies "显示所有网站Cookies">
+<!ENTITY viewcookies "查看Cookies">
+<!ENTITY deletecookies "删除Cookies">
+<!ENTITY currentpermissions "当前Cookie">
+<!ENTITY alternatecookieaccess "设置Cookie访问">
+<!ENTITY sitepermissions "网站:">
+<!ENTITY domainpermissions "域名:">
+<!ENTITY permissionsresult "设定动作:">
+<!ENTITY options "选项">
+<!ENTITY default "默认">
+<!ENTITY allow "允许">
+<!ENTITY deny "拒绝">
+<!ENTITY session "会话">
+<!ENTITY tempallow "临时允许">
+<!ENTITY thirdpartycookies "第三方Cookies">
+<!ENTITY thirdpartydefault "无">
+<!ENTITY revoketempallow "取消所有临时允许">
+<!ENTITY cookiemonsterdescription "帮助管理Cookie, 特别是当您默认拒绝Cookie的时候">
diff --git a/chrome/cookiemonster.jar!/locale/zh-CN/overrideGlobal.dtd b/chrome/cookiemonster.jar!/locale/zh-CN/overrideGlobal.dtd
new file mode 100644
index 0000000..b0e4c4b
--- /dev/null
+++ b/chrome/cookiemonster.jar!/locale/zh-CN/overrideGlobal.dtd
@@ -0,0 +1,18 @@
+<!ENTITY window.title "覆盖全局Cookie权限">
+<!ENTITY window.width "50em">
+
+
+<!ENTITY overrideglobaltext.label "仅在分网站Cookie权限不能正常工作时使用全局覆盖,尤其是在javascript中用navigator.cookieEnabled来检测cookie权限的网站.">
+<!ENTITY removepermission.label "移除网站">
+<!ENTITY removepermission.accesskey "R">
+<!ENTITY removeallpermissions.label "移除所有网站">
+<!ENTITY removeallpermissions.accesskey "e">
+<!ENTITY address.label "网站地址:">
+<!ENTITY addressexists.label "URL已经在列表中:">
+<!ENTITY addurl.label "添加URL">
+<!ENTITY addurl.accesskey "A">
+<!ENTITY windowClose.key "w">
+
+
+<!ENTITY button.close.label "关闭">
+<!ENTITY button.close.accesskey "C">
diff --git a/chrome/cookiemonster.jar!/locale/zh-CN/siteCookies.properties b/chrome/cookiemonster.jar!/locale/zh-CN/siteCookies.properties
new file mode 100644
index 0000000..086b717
--- /dev/null
+++ b/chrome/cookiemonster.jar!/locale/zh-CN/siteCookies.properties
@@ -0,0 +1,6 @@
+#### Site Cookie Viewer
+
+sitelabel=Cookies来自
+searchbyurl=按URL查找:
+clearlabel=清除
+clearaccesskey=l
diff --git a/chrome/cookiemonster.jar!/locale/zh-TW/options.dtd b/chrome/cookiemonster.jar!/locale/zh-TW/options.dtd
index 47a99bf..3ec8a55 100644
--- a/chrome/cookiemonster.jar!/locale/zh-TW/options.dtd
+++ b/chrome/cookiemonster.jar!/locale/zh-TW/options.dtd
@@ -2,9 +2,10 @@
<!ENTITY cookiemonster "Hello Cookies!">
<!ENTITY options "選項">
<!ENTITY secondlevel "使用第二層網域名稱">
+<!ENTITY bothhttpandhttps "應用Cookie設置為HTTP和HTTPS">
<!ENTITY reloadonpermissionchange "Cookie 存取權改變時自動更新受影響的頁面">
<!ENTITY enablecontextmenu "在右鍵選單顯示 Cookie Monster">
-<!ENTITY enablekeyboardshortcut "啟用鍵盤捷徑 (Ctrl Alt C)">
+<!ENTITY enablekeyboardshortcut "啟用鍵盤捷徑 (Ctrl + Alt + M)">
<!ENTITY deletecookies "存取權變為拒絕時刪除 Cookies">
<!ENTITY enableglobalcookies "啟用全域 Cookie 權限覆載">
<!ENTITY thirdPartyCookies "阻擋來自第三方的 Cookies">
diff --git a/chrome/cookiemonster.jar!/locale/zh-TW/overlay.dtd b/chrome/cookiemonster.jar!/locale/zh-TW/overlay.dtd
index b205a25..e197a0d 100644
--- a/chrome/cookiemonster.jar!/locale/zh-TW/overlay.dtd
+++ b/chrome/cookiemonster.jar!/locale/zh-TW/overlay.dtd
@@ -2,6 +2,7 @@
<!ENTITY cookiemonster "Cookie Monster">
<!ENTITY secondlevel "使用第二層網域名稱">
<!ENTITY globalpermissions "全域 Cookies 設定">
+<!ENTITY bothhttpandhttps "應用Cookie設置為HTTP和HTTPS">
<!ENTITY blockglobal "阻擋所有 Cookies(若要允許請別勾選)">
<!ENTITY blockthirdparty "只阻擋第三方 Cookies">
<!ENTITY globaloverride "覆載全域 Cookie 權限">
diff --git a/chrome/cookiemonster.jar!/skin/overlay.css b/chrome/cookiemonster.jar!/skin/overlay.css
index 9c1a9bb..ebe47aa 100644
--- a/chrome/cookiemonster.jar!/skin/overlay.css
+++ b/chrome/cookiemonster.jar!/skin/overlay.css
@@ -4,7 +4,7 @@
** Modified by: Tony Schilling
**
**
-** Date Last Modified: 11/14/2008
+** Date Last Modified: 11/08/2015
*/
/*
@@ -45,7 +45,7 @@ menuitem[name="current-access"] {
/*
** Set the temporarily items to italics
*/
-menuitem#cookie-access-top-temp, menuitem#cookie-access-second-temp, menuitem#cookie-access-third-temp, label#cookie-status-header {
+menuitem#cookiemonster-s1tony-access-top-temp, menuitem#cookiemonster-s1tony-access-second-temp, menuitem#cookiemonster-s1tony-access-third-temp, label#cookiemonster-s1tony-status-header {
font-style: italic;
}
diff --git a/defaults/preferences/defaults.js b/defaults/preferences/defaults.js
index 3a29e0e..d13a2de 100644
--- a/defaults/preferences/defaults.js
+++ b/defaults/preferences/defaults.js
@@ -1,5 +1,6 @@
pref("extensions.cookiemonster.firstRunDone", false);
pref("extensions.cookiemonster.secondlevelurl", true);
+pref("extensions.cookiemonster.bothhttpandhttps", false);
pref("extensions.cookiemonster.reloadonpermissionchange", true);
pref("extensions.cookiemonster.enablecontextmenu", false);
pref("extensions.cookiemonster.enablekeyboardshortcut", true);
diff --git a/install.rdf b/install.rdf
index 485c7b8..560d8f9 100644
--- a/install.rdf
+++ b/install.rdf
@@ -5,7 +5,7 @@
<Description about="urn:mozilla:install-manifest">
<em:id>{45d8ff86-d909-11db-9705-005056c00008}</em:id>
- <em:version>1.2.5</em:version>
+ <em:version>1.3.0.0</em:version>
<em:type>2</em:type>
<em:optionsURL>chrome://cookiemonster/content/options.xul</em:optionsURL>
<!-- <em:iconURL>chrome://cookiemonster/skin/face-monkey.png</em:iconURL> -->
@@ -16,8 +16,8 @@
<em:targetApplication> <!-- Firefox -->
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
- <em:minVersion>3.5</em:minVersion>
- <em:maxVersion>39.*</em:maxVersion>
+ <em:minVersion>6.0</em:minVersion>
+ <em:maxVersion>42.*</em:maxVersion>
</Description>
</em:targetApplication>
@@ -48,6 +48,7 @@
<em:translator>Simone Lando</em:translator>
<em:translator>Vladimir Dubinsky</em:translator>
<em:translator>Jeroen Tulp</em:translator>
+ <em:translator>Cye3s</em:translator>
<em:contributor>Jane Ocean</em:contributor>
<!-- <em:homepageURL>http://forum.addonsmirror.net/index.php?showtopic=6599</em:homepageURL> -->
@@ -101,5 +102,12 @@
<em:description>Uitgebreid Cookie beheer</em:description>
</Description>
</em:localized>
+ <em:localized>
+ <Description>
+ <em:locale>zh-CN</em:locale>
+ <em:name>Cookie Monster</em:name>
+ <em:description>全面的 Cookie 管理器</em:description>
+ </Description>
+ </em:localized>
</Description>
</RDF>
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/cookie-monster.git
More information about the Pkg-mozext-commits
mailing list