mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-04-19 06:53:31 +02:00
Fix stringToURLArray for file: URIs. Closes issue #154.
This commit is contained in:
@@ -689,13 +689,15 @@ const Util = Module("util", {
|
|||||||
urls = [str];
|
urls = [str];
|
||||||
|
|
||||||
return urls.map(function (url) {
|
return urls.map(function (url) {
|
||||||
try {
|
if (url.substr(0, 5) != "file:") {
|
||||||
// Try to find a matching file.
|
try {
|
||||||
let file = io.File(url);
|
// Try to find a matching file.
|
||||||
if (file.exists() && file.isReadable())
|
let file = io.File(url);
|
||||||
return services.get("io").newFileURI(file).spec;
|
if (file.exists() && file.isReadable())
|
||||||
|
return services.get("io").newFileURI(file).spec;
|
||||||
|
}
|
||||||
|
catch (e) {}
|
||||||
}
|
}
|
||||||
catch (e) {}
|
|
||||||
|
|
||||||
// strip each 'URL' - makes things simpler later on
|
// strip each 'URL' - makes things simpler later on
|
||||||
url = url.replace(/^\s+|\s+$/, "");
|
url = url.replace(/^\s+|\s+$/, "");
|
||||||
|
|||||||
Reference in New Issue
Block a user