mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-05 01:25:45 +01:00
Refactor the gu mapping action again.
This commit is contained in:
@@ -112,15 +112,12 @@ const Browser = Module("browser", {
|
|||||||
function (count) {
|
function (count) {
|
||||||
count = Math.max(count, 1);
|
count = Math.max(count, 1);
|
||||||
let url = util.newURI(buffer.URL);
|
let url = util.newURI(buffer.URL);
|
||||||
let path = url.path;
|
|
||||||
|
|
||||||
while (count-- && path != "/")
|
while (count-- && url.path != "/")
|
||||||
path = path.replace(/[^\/]+\/?$/, "")
|
url.path = url.path.replace(/[^\/]+\/?$/, "")
|
||||||
|
|
||||||
let newUrl = url.prePath + path
|
if (url.spec != buffer.URL)
|
||||||
|
dactyl.open(url.spec);
|
||||||
if (newUrl != buffer.URL)
|
|
||||||
dactyl.open(newUrl);
|
|
||||||
else
|
else
|
||||||
dactyl.beep();
|
dactyl.beep();
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user