Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] PoC of notification fix #919

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/features/web-compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,17 @@
})

this.defineProperty(window.Notification, 'requestPermission', {
value: () => {
return Promise.resolve('denied')
value: (callback) => {
if (callback == null) {
return Promise.resolve('denied')
}

Check failure on line 193 in src/features/web-compat.js

View workflow job for this annotation

GitHub Actions / unit (ubuntu-20.04)

Trailing spaces not allowed
if (typeof callback === 'function') {
callback('denied')

Check failure on line 195 in src/features/web-compat.js

View workflow job for this annotation

GitHub Actions / unit (ubuntu-20.04)

Unexpected literal in error position of callback
return
}
const reason = "Invalid 'callback' value passed to window.Notification.requestPermission(). Expected a function."
throw new Error(reason)
},
writable: true,
configurable: true,
Expand Down
Loading