       [ tab, tabs... ] = tabs[startTabIndex...startTabIndex + count]
       chrome.windows.create {tabId: tab.id, incognito: tab.incognito}, (window) ->
         chrome.tabs.move (tab.id for tab in tabs), {windowId: window.id, index: -1}
+        return
+      return
+    return
+
   nextTab: (request) -> selectTab "next", request
   previousTab: (request) -> selectTab "previous", request
   firstTab: (request) -> selectTab "first", request


    tabConfig.active = request.active if request.active?
    # Firefox does not support "about:newtab" in chrome.tabs.create.
    delete tabConfig["url"] if tabConfig["url"] == Settings.defaults.newTabUrl

    # Firefox <57 throws an error when openerTabId is used (issue 1238314).
    canUseOpenerTabId = not (Utils.isFirefox() and Utils.compareVersions(Utils.firefoxVersion(), "57") < 0)
    tabConfig.openerTabId = request.tab.id if canUseOpenerTabId

    chrome.tabs.create tabConfig, (tab) ->
      # clean position and active, so following `openUrlInNewTab(request)` will create a tab just next to this new tab

      active: true
    winConfig.active = request.active if request.active?
    # Firefox does not support "about:newtab" in chrome.tabs.create.
    if winConfig["url"] == Settings.defaults.newTabUrl
      delete winConfig["url"]
    chrome.windows.create winConfig, callback

muteTab = (tab) -> chrome.tabs.update tab.id, {muted: !tab.mutedInfo.muted}
toggleMuteTab = ({tab: currentTab, registryEntry, tabId, frameId}) ->
  if registryEntry.options.all? or registryEntry.options.other?
    # If there are any audible, unmuted tabs, then we mute them; otherwise we unmute any muted tabs.
    chrome.tabs.query {audible: true}, (tabs) ->
      if registryEntry.options.other?
        tabs = tabs.filter((t) => t.id != currentTab.id)
      audibleUnmutedTabs = tabs.filter((t) => t.audible and not t.mutedInfo.muted)
      if audibleUnmutedTabs.length >= 0
        chrome.tabs.sendMessage tabId, {frameId, name: "showMessage", message: "Muting #{audibleUnmutedTabs.length} tab(s)."}
        muteTab tab for tab in audibleUnmutedTabs
      else
        chrome.tabs.sendMessage tabId, {frameId, name: "showMessage", message: "Unmuting all muted tabs."}
        muteTab tab for tab in tabs when tab.mutedInfo.muted
      return
  else
    if currentTab.mutedInfo.muted
      chrome.tabs.sendMessage tabId, {frameId, name: "showMessage", message: "Unmuted tab."}
    else
      chrome.tabs.sendMessage tabId, {frameId, name: "showMessage", message: "Muted tab."}
    muteTab currentTab
  return

#
# Selects the tab with the ID specified in request.id
