var win=windowForNode(requestingNode); 
var win=this.windowForNode(requestingNode); 
	shouldLoad:function(		contentType, contentLocation, requestOrigin, requestingNode, mimeTypeGuess, extra	) {		if (!gKablEnabled) {			// when not enabled, let it through			return this.ACCEPT;		}		if ('http' !=contentLocation.scheme &&			'https'!=contentLocation.scheme &&			'ftp'  !=contentLocation.scheme		) {			// it's not a remote scheme, definitely let it through			return this.ACCEPT;		}		// Only block in content windows		var win=windowForNode(requestingNode);		var winType=win			.QueryInterface(Components.interfaces.nsIInterfaceRequestor)			.getInterface(Components.interfaces.nsIWebNavigation)			.QueryInterface(Components.interfaces.nsIDocShellTreeItem)			.itemType;		if (winType!=Components.interfaces.nsIDocShellTreeItem.typeContent) {			return this.ACCEPT;		}		try {			if (requestingNode.QueryInterface(				Components.interfaces.nsIDOMXULElement			)) {				// if the requesting node is XUL, it's the top-frame document				// if we block it, things go very wrong, so let it through				return this.ACCEPT;			}		} catch (e) {			// if it isn't there, it will throw with NS_NOINTERFACE ..			// fail silently		}		var fields=new this.Fields(			contentType, contentLocation, requestOrigin, requestingNode		);		if (gKablDebug>1) dump('\nKarma Blocker - Checking:\nloc: '+contentLocation.spec+'\norg: '+requestOrigin.spec+'\n');		var score=0, val, field, flag=false;		for (var i=0, group=null; group=gKablRulesObj.groups[i]; i++) {			if (gKablDebug>3) dump('  Group ...\n');			for (var j=0, rule=null; rule=group.rules[j]; j++) {				if (gKablDebug>4) dump('    rule = '+rule.toSource()+'\n');				flag=false;				// extract the actual value of this field				field=fields[rule[0]];				if ('string'==typeof field) field=field.toLowerCase();				// decode the match value				if ('$thirdParty'==rule[0]) {					val=new Boolean(rule[2]);				} else if ('$type'==rule[0]) {					val=Components.interfaces.nsIContentPolicy[						'TYPE_'+rule[2].toUpperCase()					];				} else {					val=rule[2].substring(1, rule[2].length-1);					val=val.toLowerCase();				}				switch (rule[1]) {					case '==': flag=field==val; break;					case '!=': flag=field!=val; break;					case '=~': flag=(new RegExp(val)).test(field); break;					case '!~': flag=!(new RegExp(val)).test(field); break;					case '^=': flag=field.substr(0, val.length)==val; break;					case '$=': flag=field.substr(field.length-val.length)==val; break;				}				if (gKablDebug>4) dump('      ' + field + ' <> ' + val + '\n');				if (gKablDebug>4) dump('      match = '+flag+'\n');				if (flag && 'any'==group.match) {					score+=group.score;					break;				} else if (!flag && 'all'==group.match) {					break;				}			}			if (flag && 'all'==group.match) {				score+=group.score;			}			// reuse flag for (possible) return value here			flag=this.evaluate('cutoff', score, requestingNode, contentLocation);			if (flag) return flag;		}		return this.evaluate('threshold', score, requestingNode, contentLocation);	},
6875	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/6875/2db1e1e3970dfe4a591b3c9ba8a1b47b36b89e8f/kabl-policy.js/buggy/content/kabl-policy.js