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:
@@ -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();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user