diff options
Diffstat (limited to 'background_scripts')
| -rw-r--r-- | background_scripts/main.coffee | 9 | 
1 files changed, 8 insertions, 1 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index a6e5a4eb..f70cd8f3 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -246,7 +246,14 @@ moveTab = (callback, direction) ->  # These are commands which are bound to keystroke which must be handled by the background page. They are  # mapped in commands.coffee.  BackgroundCommands = -  createTab: (callback) -> openUrlInNewTab { url: Settings.get("newTabUrl") }, callback +  createTab: (callback) -> +    chrome.tabs.query { active: true, currentWindow: true }, (tabs) -> +      tab = tabs[0] +      url = Settings.get "newTabUrl" +      if url == "pages/blank.html" +        # "pages/blank.html" does not work in incognito mode, so fall back to "chrome://newtab" instead. +        url = if tab.incognito then "chrome://newtab" else chrome.runtime.getURL url +      openUrlInNewTab { url }, callback    duplicateTab: (callback) ->      chrome.tabs.getSelected(null, (tab) ->        chrome.tabs.duplicate(tab.id)  | 
