aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Sand2013-02-17 03:56:16 +0000
committerTimo Sand2013-02-17 03:56:16 +0000
commit28416fe17b35875ba90bfabadb81d68e85f89010 (patch)
treeca9c3730760e7a0f7661127f02224e343a957472
parent56fbb9b7869bcba428aa71bfd7886d11db17a5fc (diff)
downloadvimium-28416fe17b35875ba90bfabadb81d68e85f89010.tar.bz2
Implemented opening links in Incognito
-rw-r--r--background_scripts/main.coffee8
-rw-r--r--content_scripts/link_hints.coffee5
2 files changed, 9 insertions, 4 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index 5818df48..72c65264 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -60,6 +60,12 @@ chrome.extension.onRequest.addListener((request, sender, sendResponse) ->
# Ensure the sendResponse callback is freed.
return false)
+chrome.extension.onMessage.addListener((request, sender, sendResponse) ->
+ if (sendRequestHandlers[request.handler])
+ sendResponse(sendRequestHandlers[request.handler](request, sender))
+ # Ensure the sendResponse callback is freed.
+ return false)
+
#
# Used by the content scripts to get their full URL. This is needed for URLs like "view-source:http:# .."
# because window.location doesn't know anything about the Chrome-specific "view-source:".
@@ -460,8 +466,6 @@ checkKeyQueue = (keysToCheck, tabId, frameId) ->
command = splitHash.command
count = splitHash.count
- console.log 'Command:', command
-
return keysToCheck if command.length == 0
count = 1 if isNaN(count)
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee
index c34692b6..ad4a2686 100644
--- a/content_scripts/link_hints.coffee
+++ b/content_scripts/link_hints.coffee
@@ -96,8 +96,9 @@ LinkHints =
HUD.show("Open link in incognito window")
@linkActivator = (link) ->
- console.log 'Incognito:', link
- openUrlInIncognitoWindow({ url: link.href})
+ chrome.extension.sendMessage(
+ handler: '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