1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 08:27:59 +01:00

Treat strings containing / as URLs

In lieu of getting proper hostname detection, allow localhost/ and other
similar URLs to work.
This commit is contained in:
Conrad Irwin
2009-03-25 01:58:39 +00:00
parent 16eb0a1148
commit d6238f84a4

View File

@@ -675,7 +675,7 @@ const util = { //{{{
// Ok, not a valid proto. If it looks like URL-ish (foo.com/bar),
// let Gecko figure it out.
if (/[.]/.test(url) && !/\s/.test(url) || /^[\w-.]+:\d+(?:\/|$)/.test(url))
if (/[.\/]/.test(url) && !/\s/.test(url) || /^[\w-.]+:\d+(?:\/|$)/.test(url))
return url;
// TODO: it would be clearer if the appropriate call to