Created
May 9, 2017 00:58
-
-
Save SuddenDevelopment/ee7ce27d7a95d7eec3567084a5d08394 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//create a new window for oAuth | |
var oAuthWindow = new BrowserWindow({ width: 480, height: 640, }); | |
//send to the destination oauth | |
oAuthWindow.loadURL(URL_TO_LOAD); | |
oAuthWindow.webContents.on('did-navigate', function (objEvent,strUrl) { | |
//console.log(objEvent,strUrl); | |
if(strUrl.indexOf(URL_MATCH_THAT_INDICATES_COMPLETE) > -1){ | |
oAuthWindow.hide(); | |
//send whatever you need to back to the main window | |
mainWindow.webContents.send('electron-msg', DATA_TO_SEND_MAIN_WINDOW_ON_COMPLETE); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment