From cd17b12177c650416e936d9e4216dabd567225cf Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Sat, 14 Nov 2009 22:48:51 -0500 Subject: [PATCH] Fix stringToURLArray for file: URIs. Closes issue #154. --- common/content/util.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/common/content/util.js b/common/content/util.js index 65420f9b..c2638cda 100644 --- a/common/content/util.js +++ b/common/content/util.js @@ -689,13 +689,15 @@ const Util = Module("util", { urls = [str]; return urls.map(function (url) { - try { - // Try to find a matching file. - let file = io.File(url); - if (file.exists() && file.isReadable()) - return services.get("io").newFileURI(file).spec; + if (url.substr(0, 5) != "file:") { + try { + // Try to find a matching file. + let file = io.File(url); + if (file.exists() && file.isReadable()) + return services.get("io").newFileURI(file).spec; + } + catch (e) {} } - catch (e) {} // strip each 'URL' - makes things simpler later on url = url.replace(/^\s+|\s+$/, "");