From 8548fcc5b31526706afb89712804c60cf8d91fbf Mon Sep 17 00:00:00 2001 From: Jez Ng Date: Sat, 21 Jan 2012 16:07:28 +0800 Subject: Treat navigation queries starting with slashes as file URIs. --- lib/utils.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/utils.js b/lib/utils.js index efdb49fb..6526fe89 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -105,6 +105,9 @@ var utils = { // trim str str = str.replace(/^\s+|\s+$/g, ''); + if (str[0] === '/') + return "file://" + str; + // it starts with a scheme, so it's definitely an URL if (/^[a-z]{3,}:\/\//.test(str)) return str; -- cgit v1.2.3