home *** CD-ROM | disk | FTP | other *** search
- var blacklistUtils = {
-
- // Set this to false to disable debug output
- DEBUG : false,
-
- // Globals
- prefService : null,
-
-
- Init : function() {
- this.debug('Init()');
-
- // Pref Service
- if (!this.prefService) {
- this.prefService = Components.classes["@mozilla.org/preferences-service;1"]
- .getService(Components.interfaces.nsIPrefBranch);
- }
- },
-
-
- IsSiteInPhishList : function(uri) {
- if (!uri) return false;
- this.lastSite = uri.spec;
- var trustLevel = sitecontrols.SCSVC.getSiteTrustLevel(uri.spec);
- var rtval = (trustLevel == 2 || trustLevel == 6);
- if (rtval)
- { // 0 = whitelist, 1 = phishlist, 2 = spylist
- var bitmask = sitecontrols.SCSVC.getSiteTrustLevelDetail(uri.spec, 1);
- var providers = sitecontrols.SCSVC.getSiteTrustProviderName(bitmask);
- this.lastSitePartners = providers.split("|");
- } else {
- // this.lastSitePartners = null;
- }
- this.debug('IsSiteInPhishList('+uri.spec+'): '+((rtval)?'Yes':'No'));
- return rtval;
- },
-
-
- IsSiteInSpywareList : function(uri) {
- if (!uri) return false;
- this.lastSite = uri.spec;
- var trustLevel = sitecontrols.SCSVC.getSiteTrustLevel(uri.spec);
- var rtval = (trustLevel == 4 || trustLevel == 6);
- if (rtval)
- {
- var bitmask = sitecontrols.SCSVC.getSiteTrustLevelDetail(uri.spec, 2);
- var providers = sitecontrols.SCSVC.getSiteTrustProviderName(bitmask);
- this.lastSitePartners = providers.split("|");
- } else {
- // this.lastSitePartners = null;
- }
- this.debug('IsSiteInSpywareList('+uri.spec+'): '+((rtval)?'Yes':'No'));
- return rtval;
- },
-
- lastSite : null,
- lastSitePartners : null,
-
- showTrustedPartners : function()
- {
- window.openDialog("chrome://browser/content/trustPartners.xul", "_blank",
- "modal,resizable,centerscreen", this.lastSitePartners);
-
- },
-
-
- debug : function(msg) {
- // set DEBUG at the top of this file to 'false'
- // to disable debug output
- if (this.DEBUG)
- dump('blacklistUtils.js: '+msg+'\n');
- }
-
- };
- blacklistUtils.Init();
-