{ "prefbar:info": { "formatversion": 3 }, "prefbar:menu:enabled": { "items": [ "prefbar:button:clear_domain_cookies", "prefbar:button:check_domain_cookie_behavior" ] }, "prefbar:button:clear_domain_cookies": { "type": "extcheck", "label": "clear domain cookies", "setfunction": "function clear_domain_cookies() {\n var domain = window._content.document.location.hostname;\n if (!domain) return;\n if (confirm(\"clear cookies for \" + domain)) {\n var cookiemanager = Components.classes[\"@mozilla.org/cookiemanager;1\"].getService();\n cookiemanager = cookiemanager.QueryInterface(Components.interfaces.nsICookieManager);\n var enumerator = cookiemanager.enumerator;\n while (enumerator.hasMoreElements()) {\n var cookie = enumerator.getNext();\n if (!cookie) break;\n cookie = cookie.QueryInterface(Components.interfaces.nsICookie);\n if (cookie.host.indexOf(domain) >= 0) {\n cookiemanager.remove(cookie.host, cookie.name, cookie.path, false);\n }\n }\n if (confirm(\"reset cookie behavior for \" + domain)) {\n var cookiepermission = Components.classes[\"@mozilla.org/cookie/permission;1\"].getService(Components.interfaces.nsICookiePermission);\n cookiepermission.setAccess(gBrowser.currentURI, 0);\n }\n }\n}\nif (!value) {\n clear_domain_cookies();\n}\n", "getfunction": "function have_domain_cookies() {\n var domain = window._content.document.location.hostname;\n if (!domain) return false;\n {\n var cookiemanager = Components.classes[\"@mozilla.org/cookiemanager;1\"].getService();\n cookiemanager = cookiemanager.QueryInterface(Components.interfaces.nsICookieManager);\n var enumerator = cookiemanager.enumerator;\n while (enumerator.hasMoreElements()) {\n var cookie = enumerator.getNext();\n if (!cookie) break;\n cookie = cookie.QueryInterface(Components.interfaces.nsICookie);\n if (cookie.host.indexOf(domain) >= 0) {\n return true;\n }\n }\n return false;\n }\n}\nvalue = have_domain_cookies();\n", "browserbtnupdatefor": "url" }, "prefbar:button:check_domain_cookie_behavior": { "type": "extlist", "label": "check domain cookie behavior", "setfunction": "var cookiepermission = Components.classes[\"@mozilla.org/cookie/permission;1\"].getService(Components.interfaces.nsICookiePermission);\ncookiepermission.setAccess(gBrowser.currentURI, value);\n", "getfunction": "var cookiepermission = Components.classes[\"@mozilla.org/cookie/permission;1\"].getService(Components.interfaces.nsICookiePermission);\nvalue = cookiepermission.canAccess(gBrowser.currentURI, null, null);\n", "browserbtnupdatefor": "url", "items": [ [ "default", "0" ], [ "allow", "1" ], [ "deny", "2" ], [ "session", "8" ] ] } }