From e4aebe5a338bdc83aafb3abf13b044e5ad1d2636 Mon Sep 17 00:00:00 2001 From: Maddison Hellstrom Date: Sat, 18 Nov 2017 00:11:22 -0800 Subject: [PATCH] Fix copyURLPath --- conf.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf.js b/conf.js index 69f170a..36119c1 100644 --- a/conf.js +++ b/conf.js @@ -67,7 +67,7 @@ mapkey('=D', "Lookup all information for domain", dnsVerbose, ri); mapkey(';se', "#11Edit Settings", editSettings, ri); mapkey(';pd', "Toggle PDF viewer from SurfingKeys", togglePdfViewer, ri); mapkey('gi', "Edit current URL with vim editor", vimEditURL, ri); -mapkey('yp', "Copy URL path of current page", copyURLPath, ri); +mapkey('yp', "Copy URL path of current page", () => copyURLPath(), ri); const siteleader = ""; @@ -229,9 +229,9 @@ function togglePdfViewer() { } function getURLPath(count, domain) { - var path = window.location.pathname; + var path = window.location.pathname.slice(1); if (count) { - path = path.split('/').slice(1,1+count).join('/'); + path = path.split('/').slice(0, count).join('/'); } if (domain) { path = window.location.hostname + '/' + path;