diff --git a/mozilla/extensions/irc/locales/en-US/chrome/chatzilla.properties b/mozilla/extensions/irc/locales/en-US/chrome/chatzilla.properties index be8aa4a1573..0b8fc42e92d 100644 --- a/mozilla/extensions/irc/locales/en-US/chrome/chatzilla.properties +++ b/mozilla/extensions/irc/locales/en-US/chrome/chatzilla.properties @@ -1502,7 +1502,7 @@ pref.identd.enabled.help = Allows ChatZilla to connect to servers that re pref.initialURLs.label = Auto-connect URLs pref.initialURLs.help = A list of IRC URLs to which ChatZilla should connect when starting. These will not be processed if ChatZilla was started by clicking on a hyperlink to an irc host. pref.initialScripts.label = Auto-load scripts -pref.initialScripts.help = When ChatZilla starts, it loads all the scripts listed here. If an item is a directory, however, it loads "init.js" from that directory, and any subdirectory. +pref.initialScripts.help = When ChatZilla starts, it loads all the scripts listed here. Each item is a URL, which may be relative to the profile directory. If an item is a directory itself, ChatZilla loads "init.js" from that directory, and any subdirectory. pref.inputSpellcheck.label = Spellcheck the inputbox pref.inputSpellcheck.help = Whether or not the inputbox will be spellchecked. Only works on recent &brandShortName; builds. pref.link.focus.label = Focus browser when opening links diff --git a/mozilla/extensions/irc/xul/content/prefs.js b/mozilla/extensions/irc/xul/content/prefs.js index a62bfec123f..ca917fc86bb 100644 --- a/mozilla/extensions/irc/xul/content/prefs.js +++ b/mozilla/extensions/irc/xul/content/prefs.js @@ -70,7 +70,6 @@ function initPrefs() scriptPath.append("scripts"); if (!scriptPath.exists()) mkdir(scriptPath); - client.prefManager.scriptPath = scriptPath; var logPath = profilePath.clone(); logPath.append("logs"); @@ -179,7 +178,7 @@ function initPrefs() ["font.size", 0, "appearance.misc"], ["identd.enabled", false, client.prefManager.identGroup], ["initialURLs", [], "startup.initialURLs"], - ["initialScripts", [getURLSpecFromFile(scriptPath.path)], + ["initialScripts", ["scripts/"], "startup.initialScripts"], ["instrumentation.key", 0, "hidden"], ["instrumentation.ceip", false, "hidden"], diff --git a/mozilla/extensions/irc/xul/content/static.js b/mozilla/extensions/irc/xul/content/static.js index 266631d9eae..96fd3a875dc 100644 --- a/mozilla/extensions/irc/xul/content/static.js +++ b/mozilla/extensions/irc/xul/content/static.js @@ -25,6 +25,7 @@ * Chiaki Koufugata chiaki@mozilla.gr.jp UI i18n * Samuel Sieb, samuel@sieb.net, MIRC color codes, munger menu, and various * James Ross, silver@warwickcompsoc.co.uk + * Gijs Kruitbosch, gijskruitbosch@gmail.com * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -742,19 +743,22 @@ function processStartupScripts() { client.plugins = new Array(); var scripts = client.prefs["initialScripts"]; + var basePath = getURLSpecFromFile(client.prefs["profilePath"]); + var baseURL = client.iosvc.newURI(basePath, null, null); for (var i = 0; i < scripts.length; ++i) { - if (scripts[i].search(/^file:|chrome:/i) != 0) + var url = client.iosvc.newURI(scripts[i], null, baseURL); + if (url.scheme != "file" && url.scheme != "chrome") { display(getMsg(MSG_ERR_INVALID_SCHEME, scripts[i]), MT_ERROR); continue; } - var path = getFileFromURLSpec(scripts[i]); + var path = getFileFromURLSpec(url.spec); if (!path.exists()) { - display(getMsg(MSG_ERR_ITEM_NOT_FOUND, scripts[i]), MT_WARN); + display(getMsg(MSG_ERR_ITEM_NOT_FOUND, url.spec), MT_WARN); continue; }