From b466d26ee559bf97e1cbf0cfd77ec0aa1d40a104 Mon Sep 17 00:00:00 2001 From: Timo Sand Date: Sat, 16 Feb 2013 22:39:39 +0000 Subject: Added `gU` command to go to root of page including current port and protocol --- content_scripts/vimium_frontend.coffee | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'content_scripts') diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index ca7af5ae..34635323 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -246,6 +246,16 @@ extend window, urlsplit = urlsplit.slice(0, Math.max(3, urlsplit.length - count)) window.location.href = urlsplit.join('/') + goRoot: (count) -> + host = window.location.hostname + port = window.location.port + protocol = window.location.protocol + + url = protocol + "//" + host + if port + url += ":" + port + window.location.href = url + toggleViewSource: -> chrome.extension.sendRequest { handler: "getCurrentTabUrl" }, (url) -> if (url.substr(0, 12) == "view-source:") -- cgit v1.2.3 From e71731aed50e8ec81b333b386f22f3e901132508 Mon Sep 17 00:00:00 2001 From: Timo Sand Date: Mon, 18 Feb 2013 10:14:31 +0000 Subject: Renamed to 'goToRoot', condensed function --- content_scripts/vimium_frontend.coffee | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'content_scripts') diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 34635323..1b97c30a 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -246,15 +246,8 @@ extend window, urlsplit = urlsplit.slice(0, Math.max(3, urlsplit.length - count)) window.location.href = urlsplit.join('/') - goRoot: (count) -> - host = window.location.hostname - port = window.location.port - protocol = window.location.protocol - - url = protocol + "//" + host - if port - url += ":" + port - window.location.href = url + goToRoot: () -> + window.location.href = window.location.origin toggleViewSource: -> chrome.extension.sendRequest { handler: "getCurrentTabUrl" }, (url) -> -- cgit v1.2.3