lib/twitch.gui.js
function popupElectronLogin(params) {
	if ( require('electron').remote )
		BrowserWindow = require('electron').remote.BrowserWindow;
	else
		BrowserWindow = require('electron').BrowserWindow;

	var url = core.REDIRECT_URL + 'oauth2/authorize?' + util.param(params);

	var win = new BrowserWindow({
		width: WIDTH,
		height: HEIGHT,
		resizable: false,
		show: false,
		webPreferences:{
      nodeIntegration: false
    }
	});

	win.loadURL(url);
	win.webContents.on('did-finish-load', function() {
		var location = URL.parse(win.webContents.getURL());

		if (location.hostname == 'api.twitch.tv' && location.pathname == '/kraken/') {
      core.setSession(util.parseFragment(location.hash));

      auth.getStatus(function(err, status) {
        if (status.authenticated) {
          core.events.emit('auth.login', status);
        }
      });

      win.close();
    }
    else {
      win.show();
    }
	});
}
function popupElectronLogin(params) {
	if ( require('electron').remote )
		BrowserWindow = require('electron').remote.BrowserWindow;
	else
		BrowserWindow = require('electron').BrowserWindow;

	var url = core.REDIRECT_URL + 'oauth2/authorize?' + util.param(params);

	var win = new BrowserWindow({
		width: WIDTH,
		height: HEIGHT,
		resizable: false,
		show: false,
		webPreferences:{
      nodeIntegration: false
    }
	});

	win.loadURL(url);
	win.webContents.on('did-finish-load', function() {
		var location = URL.parse(win.webContents.getURL());

		if (location.hostname == 'api.twitch.tv' && location.pathname == '/kraken/') {
      core.setSession(util.parseFragment(location.hash));

      auth.getStatus(function(err, status) {
        if (status.authenticated) {
          core.events.emit('auth.login', status);
        }
      });

      win.close();
    }
    else {
      win.show();
    }
	});
}
function popupElectronLogin ( params ) { if ( require ( 'electron' ) . remote ) BrowserWindow = require ( 'electron' ) . remote . BrowserWindow ; else BrowserWindow = require ( 'electron' ) . BrowserWindow ; var url = core . REDIRECT_URL + 'oauth2/authorize?' + util . param ( params ) ; var win = new BrowserWindow ( { width : WIDTH , height : HEIGHT , resizable : false , show : false , webPreferences : { nodeIntegration : false } } ) ; win . loadURL ( url ) ; win . webContents . on ( 'did-finish-load' , function ( ) { var location = URL . parse ( win . webContents . getURL ( ) ) ; if ( location . hostname == 'api.twitch.tv' && location . pathname == '/kraken/' ) { core . setSession ( util . parseFragment ( location . hash ) ) ; auth . getStatus ( function ( err , status ) { if ( status . authenticated ) { core . events . emit ( 'auth.login' , status ) ; } } ) ; win . close ( ) ; } else { win . show ( ) ; } } ) ; }
Opens a login popup using Electron's API

@private
@method popupElectronLogin
@param {Array|Object} params
Opens a login popup using Electron s API