diff --git a/js/main.js b/js/main.js index a5d9eae5..f6b45d9b 100644 --- a/js/main.js +++ b/js/main.js @@ -306,7 +306,7 @@ function createWin(urlFromConfig) { // add https protocol if none found. let parsedUrl = nodeURL.parse(urlFromConfig); - if (!parsedUrl.protocol) { + if (!parsedUrl.protocol || parsedUrl.protocol !== 'https') { parsedUrl.protocol = 'https:'; parsedUrl.slashes = true } diff --git a/js/windowMgr.js b/js/windowMgr.js index e0846e2a..3e88faf2 100644 --- a/js/windowMgr.js +++ b/js/windowMgr.js @@ -76,11 +76,17 @@ function removeWindowKey(key) { /** * Gets the parsed url - * @param url - * @returns {Url} + * @returns {String} + * @param appUrl */ -function getParsedUrl(url) { - return nodeURL.parse(url); +function getParsedUrl(appUrl) { + let parsedUrl = nodeURL.parse(appUrl); + if (!parsedUrl.protocol || parsedUrl.protocol !== 'https') { + parsedUrl.protocol = 'https:'; + parsedUrl.slashes = true + } + let url = nodeURL.format(parsedUrl); + return url; } /** @@ -330,7 +336,7 @@ function doCreateMainWindow(initialUrl, initialBounds, isCustomTitleBar) { mainWindow.webContents.on('new-window', handleNewWindow); function handleNewWindow(event, newWinUrl, frameName, disposition, newWinOptions) { - + let newWinParsedUrl = getParsedUrl(newWinUrl); let mainWinParsedUrl = getParsedUrl(url);