Conkeror: Allow location along with lh

Let the `read_url_local_port_handler' accept an optional path
parameter.
This commit is contained in:
Tom Willemsen 2013-01-16 01:31:36 +01:00
parent 521ef4749f
commit 777530f57a

View file

@ -228,13 +228,17 @@ function read_url_github_command_handler(input)
function read_url_local_port_handler(input) function read_url_local_port_handler(input)
{ {
var m = /^lh (\d{1,5})$/.exec(input); var m = /^lh (\d{1,5})(?:\s+([a-zA-Z0-9%/]+))?$/.exec(input),
rv = null;
if (m) { if (m) {
return "http://localhost:" + m[1]; rv = "http://localhost:" + m[1];
if (m[2])
rv += "/" + m[2];
} }
return null; return rv;
} }
read_url_handler_list = [read_url_local_port_handler, read_url_handler_list = [read_url_local_port_handler,