aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts/link_hints.coffee
diff options
context:
space:
mode:
authorTimo Sand2013-02-17 01:57:36 +0000
committerTimo Sand2013-02-17 01:57:36 +0000
commit56fbb9b7869bcba428aa71bfd7886d11db17a5fc (patch)
tree71525118fa98d4f766ba9253f19c9df129be8e72 /content_scripts/link_hints.coffee
parentc781ce942e225c9bc9f172cea54e0e7de6e4bcd0 (diff)
downloadvimium-56fbb9b7869bcba428aa71bfd7886d11db17a5fc.tar.bz2
Trying to add incognito window opening
Diffstat (limited to 'content_scripts/link_hints.coffee')
-rw-r--r--content_scripts/link_hints.coffee8
1 files changed, 8 insertions, 0 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee
index 1f5e5d05..c34692b6 100644
--- a/content_scripts/link_hints.coffee
+++ b/content_scripts/link_hints.coffee
@@ -12,6 +12,7 @@ OPEN_IN_CURRENT_TAB = {}
OPEN_IN_NEW_TAB = {}
OPEN_WITH_QUEUE = {}
COPY_LINK_URL = {}
+OPEN_INCOGNITO_WINDOW = {}
LinkHints =
hintMarkerContainingDiv: null
@@ -48,6 +49,7 @@ LinkHints =
activateModeToOpenInNewTab: -> @activateMode(OPEN_IN_NEW_TAB)
activateModeToCopyLinkUrl: -> @activateMode(COPY_LINK_URL)
activateModeWithQueue: -> @activateMode(OPEN_WITH_QUEUE)
+ activateModeToOpenIncognitoWindow: -> @activateMode(OPEN_INCOGNITO_WINDOW)
activateMode: (mode = OPEN_IN_CURRENT_TAB) ->
# we need documentElement to be ready in order to append links
@@ -90,6 +92,12 @@ LinkHints =
HUD.show("Copy link URL to Clipboard")
@linkActivator = (link) ->
chrome.extension.sendRequest({handler: "copyToClipboard", data: link.href})
+ else if @mode is OPEN_INCOGNITO_WINDOW
+ HUD.show("Open link in incognito window")
+
+ @linkActivator = (link) ->
+ console.log 'Incognito:', link
+ openUrlInIncognitoWindow({ url: link.href})
else # OPEN_IN_CURRENT_TAB
HUD.show("Open link in current tab")
# When we're opening the link in the current tab, don't navigate to the selected link immediately