Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pfrazee/electron-bug-notifications
This app demos a bug in Electron's notifications and permissions handling.
https://github.com/pfrazee/electron-bug-notifications
Last synced: 14 days ago
JSON representation
This app demos a bug in Electron's notifications and permissions handling.
- Host: GitHub
- URL: https://github.com/pfrazee/electron-bug-notifications
- Owner: pfrazee
- License: cc0-1.0
- Created: 2016-10-16T16:57:31.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-16T17:00:37.000Z (about 8 years ago)
- Last Synced: 2024-10-30T15:54:45.440Z (2 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# electron-bug-notifications
## To Reproduce
Install and start the app:
```bash
# Clone this repository
git clone https://github.com/pfrazee/electron-bug-notifications.git
# Go into the repository
cd electron-bug-notifications
# Install dependencies and run the app
npm install && npm start
```Scroll the webview down to the "Notify Me" button, and click it.
You will wait 5 seconds, and then the app will crash.
## The Bug
This is the code that causes the issue:
```js
app.on('ready', () => {
session.defaultSession.setPermissionRequestHandler(onPermissionRequestHandler)
})function onPermissionRequestHandler (webContents, permission, cb) {
console.log('waiting 5 seconds', permission)
setTimeout(() => { console.log('allowing', permission); cb(true) }, 5e3)
}
```It appears the crash is caused by the permission handler being given a response after time has passed.
I've only experienced the bug with the `notifications` permission.