docs: Update notifications (main) docs (#29268)
* remove version info from index.html page * remove nodeIntegration * format code and update readme * add note to user in index.html
This commit is contained in:
parent
36bca3278d
commit
5e033cb7f8
3 changed files with 11 additions and 20 deletions
|
@ -3,21 +3,17 @@ const { app, BrowserWindow, Notification } = require('electron')
|
|||
function createWindow () {
|
||||
const win = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
height: 600
|
||||
})
|
||||
|
||||
win.loadFile('index.html')
|
||||
}
|
||||
|
||||
const NOTIFICATION_TITLE = 'Basic Notification'
|
||||
const NOTIFICATION_BODY = 'Notification from the Main process'
|
||||
|
||||
function showNotification () {
|
||||
const notification = {
|
||||
title: 'Basic Notification',
|
||||
body: 'Notification from the Main process'
|
||||
}
|
||||
new Notification(notification).show()
|
||||
new Notification({ title: NOTIFICATION_TITLE, body: NOTIFICATION_BODY }).show()
|
||||
}
|
||||
|
||||
app.whenReady().then(createWindow).then(showNotification)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue