Asks to show notifications. Call it directly in a click handler, before awaiting anything, or the browser refuses.
Whether the permission is granted
When called outside a click
await requestNotificationPermission(); // true Copy
await requestNotificationPermission(); // true
export async function requestNotificationPermission(): Promise<boolean> { return chrome.permissions.request(NOTIFICATIONS);} Copy
export async function requestNotificationPermission(): Promise<boolean> { return chrome.permissions.request(NOTIFICATIONS);}
Asks to show notifications. Call it directly in a click handler, before awaiting anything, or the browser refuses.