diff --git a/browser/components/preferences/aboutPermissions.js b/browser/components/preferences/aboutPermissions.js index 11ac11790a3..c86fc30c6f1 100644 --- a/browser/components/preferences/aboutPermissions.js +++ b/browser/components/preferences/aboutPermissions.js @@ -761,12 +761,18 @@ let AboutPermissions = { permissionValue = PermissionDefaults[aType]; if (aType == "plugins") document.getElementById("plugins-pref-item").hidden = false; + else if (aType == "cookie") + // cookie-9 corresponds to ALLOW_FIRST_PARTY_ONLY, which is reserved + // for site-specific preferences only. + document.getElementById("cookie-9").hidden = true; } else { if (aType == "plugins") { document.getElementById("plugins-pref-item").hidden = !Services.prefs.getBoolPref("plugins.click_to_play"); return; } + if (aType == "cookie") + document.getElementById("cookie-9").hidden = false; let result = {}; permissionValue = this._selectedSite.getPermission(aType, result) ? result.value : PermissionDefaults[aType]; diff --git a/browser/components/preferences/aboutPermissions.xul b/browser/components/preferences/aboutPermissions.xul index 702f98000bf..e7ced9684ce 100644 --- a/browser/components/preferences/aboutPermissions.xul +++ b/browser/components/preferences/aboutPermissions.xul @@ -127,6 +127,7 @@ + diff --git a/browser/components/preferences/tests/browser_chunk_permissions.js b/browser/components/preferences/tests/browser_chunk_permissions.js index aeb1f98db96..d6a95c79a93 100644 --- a/browser/components/preferences/tests/browser_chunk_permissions.js +++ b/browser/components/preferences/tests/browser_chunk_permissions.js @@ -14,7 +14,6 @@ const TEST_URI_3 = NetUtil.newURI("http://wikipedia.org/"); const PERM_UNKNOWN = 0; const PERM_ALLOW = 1; const PERM_DENY = 2; -const PERM_SESION = 8; // used to set permissions on test sites const TEST_PERMS = { diff --git a/browser/components/preferences/tests/browser_permissions.js b/browser/components/preferences/tests/browser_permissions.js index 0c5e1b4babb..fb2bd8f040c 100644 --- a/browser/components/preferences/tests/browser_permissions.js +++ b/browser/components/preferences/tests/browser_permissions.js @@ -16,7 +16,8 @@ const TEST_PRINCIPAL_2 = Services.scriptSecurityManager.getNoAppCodebasePrincipa const PERM_UNKNOWN = 0; const PERM_ALLOW = 1; const PERM_DENY = 2; -const PERM_SESION = 8; +// cookie specific permissions +const PERM_FIRST_PARTY_ONLY = 9; // used to set permissions on test sites const TEST_PERMS = { @@ -253,6 +254,18 @@ var tests = [ is(Services.perms.testPermissionFromPrincipal(TEST_PRINCIPAL_2, "geo"), PERM_ALLOW, "permission manager shows that geolocation is allowed"); + + // change a site-specific cookie permission, just for fun + let cookieMenuList = getPermissionMenulist("cookie"); + let cookieItem = gBrowser.contentDocument.getElementById("cookie-" + PERM_FIRST_PARTY_ONLY); + cookieMenuList.selectedItem = cookieItem; + cookieMenuList.doCommand(); + is(cookieMenuList.value, PERM_FIRST_PARTY_ONLY, "menulist correctly shows that " + + "first party only cookies are allowed"); + is(Services.perms.testPermissionFromPrincipal(TEST_PRINCIPAL_2, "cookie"), + PERM_FIRST_PARTY_ONLY, "permission manager shows that first party cookies " + + "are allowed"); + runNextTest(); }, diff --git a/browser/locales/en-US/chrome/browser/preferences/aboutPermissions.dtd b/browser/locales/en-US/chrome/browser/preferences/aboutPermissions.dtd index 071791638e0..5b13abf8322 100644 --- a/browser/locales/en-US/chrome/browser/preferences/aboutPermissions.dtd +++ b/browser/locales/en-US/chrome/browser/preferences/aboutPermissions.dtd @@ -20,6 +20,7 @@ +