pile0nades wrote:Use this as your userChrome.js file:Code: Select all
/* :::::::: Sub-XUL/Script Loader ::::::::::::::: */
// automatically includes all files ending in .uc.xul and .uc.js from the profile's chrome folder
(function() {
var chromeDir = Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties).get("UChrm", Components.interfaces.nsILocalFile);
var files = chromeDir.directoryEntries.QueryInterface(Components.interfaces.nsISimpleEnumerator);
if(files.hasMoreElements()) loadXULorJS(files);
function loadXULorJS(files) {
var file = files.getNext().QueryInterface(Components.interfaces.nsIFile);
if (/(^userChrome|\.uc)\.xul$/i.test(file.leafName)) {
document.loadOverlay(Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService).getProtocolHandler("file").QueryInterface(Components.interfaces.nsIFileProtocolHandler).getURLSpecFromFile(file), null);
}
else if(/\.uc\.js$/i.test(file.leafName)) {
Components.classes["@mozilla.org/moz/jssubscript-loader;1"].getService(Components.interfaces.mozIJSSubScriptLoader).loadSubScript(Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService).getProtocolHandler("file").QueryInterface(Components.interfaces.nsIFileProtocolHandler).getURLSpecFromFile(file));
}
if(files.hasMoreElements()) setTimeout(loadXULorJS, 0, files);
}
})();
I removed the top code because this sub-script loader will load a userChrome.xul file too, so with the top code, the file would have been loaded twice.
You're probably gonna kill me but using the above gives me nothing, meaning no .xul or .js that will work. I've tried on new profile, existing profile/s and my main profile without success. I'm trying to find out what it is that's causing it. I'll be the first to admit that it possibly could be my coding except for the fact that alot of the scripts/code came from users such as yourself, meaning yall know what you're doing.