rem: links[c].href.test(/xml$|rss|rdf|atom|feed/i) && links[c].host.test(new RegExp(document_host, "i"))) { 
add: links[c].href.match(/xml$|rss|rdf|atom|feed|syndicate/i) && links[c].host.match(new RegExp(document_host, "i"))) { 
context: function init() {	var discoveryMode = CommonFunc.getPrefValue(CommonFunc.FEED_DISCOVERY_MODE, "str", "exhaustive");	initServices();	initBMService();	strRes = document.getElementById("strRes");	statusDeck = document.getElementById("statusDeck");	statusMessage = document.getElementById("statusMessage");	progressMeter = document.getElementById("progress");	feedTree = document.getElementById("feedTree");	dataSource = Components.classes["@mozilla.org/rdf/datasource;1?name=in-memory-datasource"];	rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"];	rdfService = rdf.getService(Components.interfaces.nsIRDFService);	ds = dataSource.createInstance(Components.interfaces.nsIRDFInMemoryDataSource);	feedTree.database.AddDataSource(ds);	schema = "http://sage.mozdev.org/FeedData#";	ds = feedTree.database.GetDataSources();	ds = ( ds.getNext(), ds.getNext() );	ds = ds.QueryInterface(Components.interfaces.nsIRDFDataSource);	var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(Components.interfaces.nsIWindowMediator);	var browserWindow = windowManager.getMostRecentWindow("navigator:browser").document.getElementById("content");	bookmarksTree = window.arguments[0];	var current_document = browserWindow.contentDocument;	document_host = current_document.location.host;	if(document_host.match(/^www\./i)) {		document_host = document_host.substring(4, document_host.length);	}	possibleFeeds = new Array();	var links, c;	// Allowing file: might not seem good but the XMLHttpRequest will prevent	// access to the file system if needed.	var uriSchemeRe = /^(http|https|ftp|file):$/;	if(discoveryMode == "exhaustive") {		links = current_document.getElementsByTagName("a");		for(c = 0; c < links.length; c++) {			if(uriSchemeRe.test(links[c].protocol) && links[c].href.test(/xml$|rss|rdf|atom|feed/i)) {				possibleFeeds[links[c].href] = Array(links[c].href, "implicit");			}		}	} else {		links = current_document.getElementsByTagName("a");		for(c = 0; c < links.length; c++) {			if(uriSchemeRe.test(links[c].protocol) &&			   links[c].href.test(/xml$|rss|rdf|atom|feed/i) &&			   links[c].host.test(new RegExp(document_host, "i"))) {				possibleFeeds[links[c].href] = Array(links[c].href, "implicit");			}		}	}	links = current_document.getElementsByTagName("link");	for(c = 0; c < links.length; c++) {		if(links[c].rel == "alternate" && (links[c].type == "text/xml" || links[c].type == "application/atom+xml" || links[c].type == "application/rss+xml")) {			possibleFeeds[links[c].href] = Array(links[c].href, "explicit");		}	}	fetch_total = 0;	fetch_done = 0;	feeds_found_local = 0;	feeds_found_external = 0;	for(entry in possibleFeeds) {		fetch_total++;	}	if(fetch_total == 0) {		progressUpdate();	}	logMessage("found " + fetch_total + " potential feed URI(s) in " + current_document.location);	var httpReq;	for(entry in possibleFeeds) {		httpReq = new XMLHttpRequest();		httpReq.onload = httpLoaded;		httpReq.onerror = httpError;		try {			httpReq.open("GET", possibleFeeds[entry][0], true);			httpReq.setRequestHeader("User-Agent", CommonFunc.USER_AGENT);			httpReq.overrideMimeType("application/xml");			httpReq.send(null);		} catch(e) {			httpReq.abort();			progressUpdate();		}	}}
meta: 359	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/359/72b05c1b714277d89a295d0990326e57f4a78a86/discover_feeds.js/buggy/src/sage/content/discover_feeds.js