Open ghost opened 5 years ago
You can put this into your userChrome.js file to load all files in your chrome directory with names ending in ".uc.js".
This sample should make it clear how to load files with other names as you wish.
let protocolHandler = Services.io.getProtocolHandler("file").
QueryInterface(Components.interfaces.nsIFileProtocolHandler);
let userChromeDirectory = Services.dirsvc.get("UChrm", Ci.nsIFile);
for (let file of userChromeDirectory.directoryEntries) {
if (! file.leafName.endsWith(".uc.js"))
continue;
let url = protocolHandler.getURLSpecFromFile(file);
Services.scriptloader.loadSubScriptWithOptions(url, {
target: document.defaultView,
charset: "UTF-8",
ignoreCache: true
});
}
Hello.
Is it possible to load and run all user scripts located in the chrome profile directory on program start? So there is no need to store all scripts in one single userChrome.js file?
Thanks!