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:
Jeremy Foster 2021-05-26 18:18:50 -07:00 committed by GitHub
parent 36bca3278d
commit 5e033cb7f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 20 deletions

View file

@ -55,18 +55,17 @@ Starting with a working application from the
```javascript fiddle='docs/fiddles/features/notifications/main'
const { Notification } = require('electron')
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)
```
After launching the Electron application, you should see the notification:
After launching the Electron application, you should see the system notification:
![Notification in the Main process](../images/notification-main.png)