rem: doc.load(getScriptChrome("config.xml")); 
add: try { doc.load(getScriptChrome("config.xml")); } catch (exc) { doc.load(getScriptChrome("default-config.xml")); } 
context: function Config() {	this.onload = null;	this.scripts = null;	this.find = function(namespace, name) {		namespace = namespace.toLowerCase();		name = name.toLowerCase();		for (var i = 0, script = null; (script = this.scripts[i]); i++) {			if (script.namespace.toLowerCase() == namespace && script.name.toLowerCase() == name) {				return i;			}		}		return -1;	}		this.load = function() {		var doc = document.implementation.createDocument("", "", null);		doc.async = false;		doc.load(getScriptChrome("config.xml"));		var nodes = document.evaluate("/UserScriptConfig/Script", doc, null, 0, null);		this.scripts = [];		for (var node = null; (node = nodes.iterateNext()); ) {			var script = new Script();			for (var i = 0, childNode = null; (childNode = node.childNodes[i]); i++) {				if (childNode.nodeName == "Include") {					script.includes.push(childNode.firstChild.nodeValue);				}				else if (childNode.nodeName == "Exclude") {					script.excludes.push(childNode.firstChild.nodeValue);				}			}			script.id = node.getAttribute("id");			script.name = node.getAttribute("name");			script.namespace = node.getAttribute("namespace");			script.description = node.getAttribute("description");			script.enabled = node.getAttribute("enabled") == true.toString();			this.scripts.push(script);		}	}	this.save = function() {		var doc = document.implementation.createDocument("", "UserScriptConfig", null);				for (var i = 0, scriptObj = null; (scriptObj = this.scripts[i]); i++) {			var scriptNode = doc.createElement("Script");			for (var j = 0; j < scriptObj.includes.length; j++) {				var includeNode = doc.createElement("Include");				includeNode.appendChild(doc.createTextNode(scriptObj.includes[j]));				scriptNode.appendChild(doc.createTextNode("\n\t\t"));				scriptNode.appendChild(includeNode);			}			for (var j = 0; j < scriptObj.excludes.length; j++) {				var excludeNode = doc.createElement("Exclude");				excludeNode.appendChild(doc.createTextNode(scriptObj.excludes[j]));				scriptNode.appendChild(doc.createTextNode("\n\t\t"));				scriptNode.appendChild(excludeNode);			}			scriptNode.appendChild(doc.createTextNode("\n\t"));			scriptNode.setAttribute("id", scriptObj.id);			scriptNode.setAttribute("name", scriptObj.name);			scriptNode.setAttribute("namespace", scriptObj.namespace);			scriptNode.setAttribute("description", scriptObj.description);			scriptNode.setAttribute("enabled", scriptObj.enabled);			doc.firstChild.appendChild(doc.createTextNode("\n\t"));			doc.firstChild.appendChild(scriptNode);		}		doc.firstChild.appendChild(doc.createTextNode("\n"))		var configStream = getWriteStream("config.xml");		new XMLSerializer().serializeToStream(doc, configStream, "utf-8");		configStream.close();	}}
meta: 4585	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4585/93cdf35046325b8aae790fb34f96e307db2c2f49/greasemonkey.js/clean/src/content/greasemonkey.js