aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/main.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 /background_scripts/main.coffee
parentc781ce942e225c9bc9f172cea54e0e7de6e4bcd0 (diff)
downloadvimium-56fbb9b7869bcba428aa71bfd7886d11db17a5fc.tar.bz2
Trying to add incognito window opening
Diffstat (limited to 'background_scripts/main.coffee')
-rw-r--r--background_scripts/main.coffee7
1 files changed, 7 insertions, 0 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index d9229f12..5818df48 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -162,6 +162,9 @@ openUrlInNewTab = (request) ->
chrome.tabs.getSelected(null, (tab) ->
chrome.tabs.create({ url: Utils.convertToUrl(request.url), index: tab.index + 1, selected: true }))
+openUrlInIncognitoWindow = (request) ->
+ chrome.windows.create({ url: Utils.convertToUrl(request.url), incognito: true})
+
#
# Called when the user has clicked the close icon on the "Vimium has been updated" message.
# We should now dismiss that message in all tabs.
@@ -398,6 +401,7 @@ getActualKeyStrokeLength = (key) ->
key.length
populateValidFirstKeys = ->
+ console.log 'Command registry:', Commands.keyToCommandRegistry
for key of Commands.keyToCommandRegistry
if (getActualKeyStrokeLength(key) == 2)
validFirstKeys[splitKeyIntoFirstAndSecond(key).first] = true
@@ -456,6 +460,8 @@ 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)
@@ -546,6 +552,7 @@ sendRequestHandlers =
getCompletionKeys: getCompletionKeysRequest,
getCurrentTabUrl: getCurrentTabUrl,
openUrlInNewTab: openUrlInNewTab,
+ openUrlInIncognitoWindow: openUrlInIncognitoWindow,
openUrlInCurrentTab: openUrlInCurrentTab,
openOptionsPageInNewTab: openOptionsPageInNewTab,
registerFrame: registerFrame,