зеркало из https://github.com/mozilla/pjs.git
fix bug 32979, ability to block cookies when removing them with the cookie viewer
This commit is contained in:
Родитель
b291cad2e8
Коммит
c709a26ea0
|
@ -2578,6 +2578,7 @@ COOKIE_CookieViewerReturn(nsAutoString results) {
|
|||
|
||||
/* step through all cookies and delete those that are in the sequence */
|
||||
char * gone = cookie_FindValueInArgs(results, "|goneC|");
|
||||
char * block = cookie_FindValueInArgs(results, "|block|");
|
||||
cookie_LockList();
|
||||
if (cookie_cookieList) {
|
||||
count = cookie_cookieList->Count();
|
||||
|
@ -2585,6 +2586,11 @@ COOKIE_CookieViewerReturn(nsAutoString results) {
|
|||
count--;
|
||||
cookie = NS_STATIC_CAST(cookie_CookieStruct*, cookie_cookieList->ElementAt(count));
|
||||
if (cookie && cookie_InSequence(gone, count)) {
|
||||
if (PL_strlen(block) && block[0]=='t') {
|
||||
char * hostname = nsnull;
|
||||
StrAllocCopy(hostname, cookie->host);
|
||||
permission_Add(hostname, PR_FALSE, COOKIEPERMISSION, PR_TRUE);
|
||||
}
|
||||
cookie_FreeCookie(cookie);
|
||||
cookie_cookiesChanged = PR_TRUE;
|
||||
}
|
||||
|
@ -2593,6 +2599,7 @@ COOKIE_CookieViewerReturn(nsAutoString results) {
|
|||
cookie_Save();
|
||||
cookie_UnlockList();
|
||||
nsCRT::free(gone);
|
||||
nsCRT::free(block);
|
||||
|
||||
/* step through all permissions and delete those that are in the sequence */
|
||||
for (PRInt32 type = 0; type < NUMBER_OF_PERMISSIONS; type++) {
|
||||
|
|
|
@ -31,3 +31,5 @@
|
|||
<!ENTITY cannotSet.label "cannot set cookies">
|
||||
<!ENTITY canLoad.label "can load images">
|
||||
<!ENTITY cannotLoad.label "cannot load images">
|
||||
|
||||
<!ENTITY checkbox.label "Don't allow removed cookies to be reaccepted later">
|
||||
|
|
|
@ -347,7 +347,7 @@ function DeletePermissionSelected()
|
|||
|
||||
function DeleteAllPermissions() {
|
||||
// delete selected item
|
||||
gone_p += DeleteAllItems(permissions.length, "permtree_", "permissionlist");
|
||||
gone_p += DeleteAllItems(permissions.length, "permtree_", "permissionslist");
|
||||
if( !document.getElementById("removePermissions").disabled ) {
|
||||
document.getElementById("removePermissions").setAttribute("disabled", "true")
|
||||
}
|
||||
|
@ -439,7 +439,8 @@ function DeleteAllImages() {
|
|||
// function : <CookieViewer.js>::doOKButton();
|
||||
// purpose : saves the changed settings and closes the dialog.
|
||||
function onOK(){
|
||||
var result = "|goneC|" + gone_c + "|goneP|" + gone_p + "|goneI|" + gone_i+ "|";
|
||||
var result = "|goneC|" + gone_c + "|goneP|" + gone_p + "|goneI|" + gone_i +
|
||||
"|block|" + document.getElementById("checkbox").checked +"|";
|
||||
cookieviewer.SetValue(result, window);
|
||||
return true;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче