output=function(str) {
    if (str.length>0 && str.charAt(str.length-1)!='\n') {
      str+='\n'
    }
    logLines.push(str);
    if (logListener) {
      logListener(str);
    }
  }
Listens for the app launching then creates the window

@see https://developer.chrome.com/apps/app_runtime
@see https://developer.chrome.com/apps/app_window