1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-06 06:44:12 +01:00

Refactor the gu mapping action again.

This commit is contained in:
Doug Kearns
2010-10-17 01:25:53 +11:00
parent e879395cb2
commit a507900e04

View File

@@ -112,15 +112,12 @@ const Browser = Module("browser", {
function (count) {
count = Math.max(count, 1);
let url = util.newURI(buffer.URL);
let path = url.path;
while (count-- && path != "/")
path = path.replace(/[^\/]+\/?$/, "")
while (count-- && url.path != "/")
url.path = url.path.replace(/[^\/]+\/?$/, "")
let newUrl = url.prePath + path
if (newUrl != buffer.URL)
dactyl.open(newUrl);
if (url.spec != buffer.URL)
dactyl.open(url.spec);
else
dactyl.beep();
},