From 0b18cfc6603495e8ad656a67c1bd20e2723cf5b3 Mon Sep 17 00:00:00 2001 From: dev-AshishRanjan <94990764+dev-AshishRanjan@users.noreply.github.com> Date: Wed, 17 Jan 2024 22:22:44 +0530 Subject: [PATCH] fix: checkProxy for linux --- src/index.js | 12 ++++++++++-- src/preload.js | 3 ++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index 9e7955a..70f25ab 100644 --- a/src/index.js +++ b/src/index.js @@ -33,6 +33,7 @@ const createWindow = () => { }, // autoHideMenuBar: true, icon: path.join(__dirname, "./assets/icons/icon_512.png"), + roundedCorners: true, }); mainWindow.setIcon(path.join(__dirname, "./assets/icons/icon_512.png")); // and load the index.html of the app. @@ -65,6 +66,7 @@ const createDynamicWindow = (file) => { fullscreenable: false, resizable: false, icon: path.join(__dirname, "./assets/icons/icon_512.png"), + roundedCorners: true, }); dynamicWindow.setIcon(path.join(__dirname, "./assets/icons/icon_512.png")); @@ -88,6 +90,7 @@ const createURLWindow = (file) => { autoHideMenuBar: true, resizable: false, icon: path.join(__dirname, "./assets/icons/icon_512.png"), + roundedCorners: true, }); dynamicWindow.setIcon(path.join(__dirname, "./assets/icons/icon_512.png")); @@ -206,6 +209,11 @@ const menu = [ click: () => createURLWindow(), accelerator: "CmdOrCtrl+F", }, + { + label: "Open Dev Tools", + click: () => mainWindow.webContents.openDevTools(), + accelerator: "CmdOrCtrl+O", + }, ], }, ] @@ -265,11 +273,11 @@ const checkProxy = () => { linuxProxy = undefined; } mainWindow.webContents.send("proxy:check:success", { - msg: `current system proxy : ${currentProxy}`, + msg: `current system proxy : ${linuxProxy}`, proxy: linuxProxy, }); dynamicWindow.webContents.send("proxy:check:success", { - msg: `current system proxy : ${currentProxy}`, + msg: `current system proxy : ${linuxProxy}`, proxy: linuxProxy, }); } else { diff --git a/src/preload.js b/src/preload.js index f56eb4e..2f853b2 100644 --- a/src/preload.js +++ b/src/preload.js @@ -132,10 +132,11 @@ const checkCurrentProxy = (callback) => { console.log({ currentProxy }); if (process.platform === "linux") { // checking proxy - if (currentProxy.includes("HTTP_PROXY")) { + if (stdout.includes("HTTP_PROXY")) { // proxy present const temp = currentProxy.split("HTTP_PROXY="); const linuxProxy = temp[temp.length - 1]; + console.log({linuxProxy}); callback(linuxProxy, null); } else { // no proxy