 _ = require 'underscore'
 {BrowserWindow} = require 'electron'
 global.windows = windows = []
+global.windowsIndex = windowsIndex = {}
 
 forceClose = false
 state = []  # Window state before hide

  openFocusedWindowDevTools: ->
    BrowserWindow.getFocusedWindow()?.openDevTools
      detach: true

        'web-security': false
        'plugins': true
    current = new BrowserWindow options
    if options.indexName?
      windowsIndex[options.indexName] = current
    # Default menu in v0.27.3
    if process.versions['electron'] >= '0.27.3'
      current.setMenu options.menu || null
