From 2bd19da10f15c1776bc82d17c00e39b588cc08eb Mon Sep 17 00:00:00 2001 From: p-sam Date: Sun, 12 Sep 2021 15:39:20 +0200 Subject: [PATCH] replace deprecated url.format with win.loadFile --- lib/index.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/index.js b/lib/index.js index fd3ce09..46dd3d2 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,4 +1,3 @@ -const url = require('url'); const path = require('path'); const electron = require('electron'); @@ -138,14 +137,10 @@ function electronPrompt(options, parentWindow) { resolve(null); }); - const promptUrl = url.format({ - protocol: 'file', - slashes: true, - pathname: path.join(__dirname, 'page', 'prompt.html'), - hash: id, - }); - - promptWindow.loadURL(promptUrl); + promptWindow.loadFile( + path.join(__dirname, 'page', 'prompt.html'), + {hash: id}, + ); }); }