Skip to content

Instantly share code, notes, and snippets.

@SuddenDevelopment
Created June 20, 2017 14:52
Show Gist options
  • Save SuddenDevelopment/ccbf80dda6990beae5c0253b3f4ed409 to your computer and use it in GitHub Desktop.
Save SuddenDevelopment/ccbf80dda6990beae5c0253b3f4ed409 to your computer and use it in GitHub Desktop.
electron pass info from a custom protocol url to the main window before it opens
// capture any data you need from the url that opened the app
app.on('open-url',function(e, strUrl){
var someThingToUse = strUrl;
});
const createWindow = () => {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 1280,
height: 800,
});
mainWindow.loadURL(`file://${__dirname}/index.html?`+someThingToUse);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment