93788e76e0
Refs #20442 Adds the basic notification and notification with custom image examples from electron-api-demos into runnable Fiddle examples. Gist links to Fiddles (same as code submitted in this PR): Basic Notification: https://gist.github.com/102945f83f559e7944797175d8fd8af4 Notification with image: https://gist.github.com/2688bf4bfc27ce02f5d74224828eb928 Co-Authored-By: Erick Zhao <erick@hotmail.ca>
25 lines
451 B
JavaScript
25 lines
451 B
JavaScript
const { BrowserWindow, app } = require('electron')
|
|
|
|
let mainWindow = null
|
|
|
|
function createWindow () {
|
|
const windowOptions = {
|
|
width: 600,
|
|
height: 300,
|
|
title: 'Advanced Notification',
|
|
webPreferences: {
|
|
nodeIntegration: true
|
|
}
|
|
}
|
|
|
|
mainWindow = new BrowserWindow(windowOptions)
|
|
mainWindow.loadFile('index.html')
|
|
|
|
mainWindow.on('closed', () => {
|
|
mainWindow = null
|
|
})
|
|
}
|
|
|
|
app.on('ready', () => {
|
|
createWindow()
|
|
})
|