Bug 1312361 - Clear all sites data from the Site Data section
MozReview-Commit-ID: 7JbzO7TQaeX
"use strict";
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService",
"resource://gre/modules/ContextualIdentityService.jsm");
this.EXPORTED_SYMBOLS = [
"CookiesUtil"
];
this.CookiesUtil = {
isPrivateCookie(cookie) {
var { userContextId } = cookie.originAttributes;
if (!userContextId) {
// Default identity is public.
return false;
}
return !ContextualIdentityService.getIdentityFromId(userContextId).public;
},
makeStrippedHost(host) {
var formattedHost = host.charAt(0) == "." ? host.substring(1, host.length) : host;
return formattedHost.substring(0, 4) == "www." ? formattedHost.substring(4, formattedHost.length) : formattedHost;
}
};