aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--commands.js2
-rw-r--r--vimiumFrontend.js4
2 files changed, 3 insertions, 3 deletions
diff --git a/commands.js b/commands.js
index c86b129f..3b9203dc 100644
--- a/commands.js
+++ b/commands.js
@@ -170,7 +170,7 @@ addCommand('goBack', 'Go back in history');
addCommand('goForward', 'Go forward in history');
// Navigating the URL hierarchy
-addCommand('goUp', 'Go up the URL hierarchy');
+addCommand('goUp', 'Go up the URL hierarchy', false, true);
// Manipulating tabs:
addCommand('nextTab', 'Go one tab right', true);
diff --git a/vimiumFrontend.js b/vimiumFrontend.js
index e3c28371..a18c7966 100644
--- a/vimiumFrontend.js
+++ b/vimiumFrontend.js
@@ -266,7 +266,7 @@ function reload() { window.location.reload(); }
function goBack() { history.back(); }
function goForward() { history.forward(); }
-function goUp() {
+function goUp(count) {
var url = window.location.href;
if (url[url.length-1] == '/')
url = url.substring(0, url.length - 1);
@@ -274,7 +274,7 @@ function goUp() {
var urlsplit = url.split('/');
// make sure we haven't hit the base domain yet
if (urlsplit.length > 3) {
- delete urlsplit[urlsplit.length-1];
+ urlsplit = urlsplit.slice(0, Math.max(3, urlsplit.length - count));
window.location.href = urlsplit.join('/');
}
}