From 3829b94bf7408abf3cb74d4beca77dca16244edc Mon Sep 17 00:00:00 2001 From: Fabio Di Stasio Date: Fri, 18 Jun 2021 21:08:21 +0200 Subject: [PATCH] refactor: solved deprecation warning for url.format() --- src/main/index.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/main/index.js b/src/main/index.js index 79a2b243..3ecc3b53 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -2,7 +2,6 @@ import { app, BrowserWindow, nativeImage } from 'electron'; import * as path from 'path'; -import { format as formatUrl } from 'url'; import Store from 'electron-store'; import ipcHandlers from './ipc-handlers'; @@ -47,13 +46,8 @@ async function createMainWindow () { const toolName = await installExtension(VUEJS_DEVTOOLS); console.log(toolName, 'installed'); } - else { - await window.loadURL(formatUrl({ - pathname: path.join(__dirname, 'index.html'), - protocol: 'file', - slashes: true - })); - } + else + await window.loadURL(new URL(`file:///${path.join(__dirname, 'index.html')}`).href); } catch (err) { console.log(err);