Bug 246273 - Use a relative path for the initialScripts pref. r=silver@warwickcompsoc.co.uk (James Ross), a=NPOTFFB.

git-svn-id: svn://10.0.0.236/trunk@258572 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
gijskruitbosch%gmail.com
2009-10-03 21:14:08 +00:00
parent 22fa3fa50f
commit 10ce665b80
3 changed files with 9 additions and 6 deletions

View File

@@ -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

View File

@@ -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"],

View File

@@ -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;
}