From a507900e04f0cdb1f2325ce15dbdfad5254549c2 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 17 Oct 2010 01:25:53 +1100 Subject: [PATCH] Refactor the gu mapping action again. --- common/content/browser.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/common/content/browser.js b/common/content/browser.js index bb21c73f..8b8a1722 100644 --- a/common/content/browser.js +++ b/common/content/browser.js @@ -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(); },