Notifications Test

This commit is contained in:
smartfridge 2021-05-03 20:52:11 +02:00
parent 3e379d9580
commit 15eb2f867f

10
main.js
View file

@ -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.