From 060b7d110ecb4d2f4c097c5128cea3d25b3260ec Mon Sep 17 00:00:00 2001 From: Aryan Karamtoth <88923986+SpaciousCoder78@users.noreply.github.com> Date: Sun, 10 Dec 2023 14:22:06 +0530 Subject: [PATCH] added sign in option --- package.json | 6 +++--- src/main.ts | 21 ++++++++++++++++++++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index c9f3aea..3df8b2e 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "youtube-music-desktop", "productName": "Youtube Music Desktop", - "version": "1.0.0", + "version": "1.0.1", "description": "My Electron application description", "main": ".vite/build/main.js", "scripts": { - "start": "electron main.js", - "package": "electron-builder build", + "start": "electron-forge start", + "package": "electron-forge package", "make": "electron-forge make", "publish": "electron-forge publish", "lint": "eslint --ext .ts,.tsx ." diff --git a/src/main.ts b/src/main.ts index e2e69ee..b59618e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -15,7 +15,26 @@ const createWindow = () => { preload: path.join(__dirname, 'preload.js'), }, }); - mainWindow.setMenuBarVisibility(false) // and load the index.html of the app. + mainWindow.setMenuBarVisibility(false) + mainWindow.webContents.setWindowOpenHandler(({ url }) => { + if (url === 'about:blank') { + return { + action: 'allow', + overrideBrowserWindowOptions: { + frame: false, + fullscreenable: false, + backgroundColor: 'black', + webPreferences: { + preload: 'my-child-window-preload-script.js' + } + } + } + } + return { action: 'deny' } + }) + + + // and load the index.html of the app. try{ mainWindow.loadURL("https://music.youtube.com") }