aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts
diff options
context:
space:
mode:
Diffstat (limited to 'background_scripts')
-rw-r--r--background_scripts/commands.coffee4
-rw-r--r--background_scripts/main.coffee7
2 files changed, 10 insertions, 1 deletions
diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee
index d7c332f9..b85afbdb 100644
--- a/background_scripts/commands.coffee
+++ b/background_scripts/commands.coffee
@@ -108,7 +108,7 @@ Commands =
advancedCommands: [
"scrollToLeft", "scrollToRight",
"goUp", "focusInput", "LinkHints.activateModeWithQueue",
- "goPrevious", "goNext", "Marks.activateCreateMode", "Marks.activateGotoMode"]
+ "LinkHints.activateModeToOpenIncognitoWindow", "goPrevious", "goNext", "Marks.activateCreateMode", "Marks.activateGotoMode"]
defaultKeyMappings =
"?": "showHelp"
@@ -212,6 +212,8 @@ commandDescriptions =
'LinkHints.activateModeToOpenInNewTab': ["Open a link in a new tab"]
'LinkHints.activateModeWithQueue': ["Open multiple links in a new tab"]
+ "LinkHints.activateModeToOpenIncognitoWindow": ["Open a link in incognito window"]
+
enterFindMode: ["Enter find mode"]
performFind: ["Cycle forward to the next find match"]
performBackwardsFind: ["Cycle backward to the previous find match"]
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,