1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-13 01:05:46 +01:00

Fix stringToURLArray for file: URIs. Closes issue #154.

This commit is contained in:
Kris Maglione
2009-11-14 22:48:51 -05:00
parent a5f30ec7cc
commit cd17b12177

View File

@@ -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+$/, "");