From 15eb2f867fc17f99a4b7be4c4a48e0f78966d443 Mon Sep 17 00:00:00 2001 From: smartfridge <37928912+smartfrigde@users.noreply.github.com> Date: Mon, 3 May 2021 20:52:11 +0200 Subject: [PATCH] Notifications Test --- main.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 5e11f5e..0bc6535 100644 --- a/main.js +++ b/main.js @@ -37,7 +37,17 @@ function createWindow() { app.whenReady().then(() => { createWindow() session.defaultSession.loadExtension(`${require('electron').app.getAppPath()}/goosemod/`) - + session + .fromPartition("some-partition") + .setPermissionRequestHandler((webContents, permission, callback) => { + const url = webContents.getURL(); + + if (permission === "notifications") { + // Approves the permissions request + callback(true); + + } + }); app.on('activate', function () { // On macOS it's common to re-create a window in the app when the // dock icon is clicked and there are no other windows open.