Questions tagged [web-notifications]

The Web Notifications API provides a way for a web application to show a platform-level notification to a users — outside of a browser’s viewport and regardless of whether the web application that generated the notification is in the currently-active tab/window.

Web Notifications API for end-user notifications provides a way to alert users — outside the context of a web page — of an occurrence such as the delivery of an e-mail message.

https://notifications.spec.whatwg.org/

139 questions
196
votes
9 answers

How to send push notification to web browser?

I have been reading for past few hours about Push Notification API and Web Notification API. I also discovered that Google & Apple gives push notification service for free via GCM and APNS respectively. I am trying to understand if we can implement…
esafwan
  • 14,622
  • 30
  • 99
  • 154
64
votes
2 answers

Send desktop notifications in Chrome or Firefox from a closed web app?

My goal is to send Gmail-style desktop notifications in Chrome or Firefox from a web app (let's call it X) that is NOT currently open in the browser, without requiring the user to install an app or extension. It's okay if the user needs to grant…
40
votes
4 answers

HTML5 Notification not working in Mobile Chrome

I'm using the HTML5 notification API to notify the user in Chrome or Firefox. On desktop browsers, it works. However in Chrome 42 for Android, the permission is requested but the notification itself is not displayed. The request code, works on all…
Jorn
  • 16,599
  • 15
  • 67
  • 103
15
votes
3 answers

How do Stack Overflow desktop notifications work?

Perhaps this is a fairly big and ambiguous question: In the Stack Overflow chatrooms, there is a button to "enable desktop notifications," which will show something in the system tray when someone replies to you. By what mechanism does this work?…
corvid
  • 9,275
  • 11
  • 50
  • 108
13
votes
1 answer

How to auto focus browser tab when clicking on browser notification in Chrome?

I am trying to setup browser notification for a project I'm working on. The code I have so far is: // Notification permissions logic handled before... var notification = new Notification('Title', { body: 'Message' }); notification.onclick = function…
Marko
  • 11,003
  • 8
  • 43
  • 55
13
votes
1 answer

How to get focus to the tab when a desktop notification is clicked in Firefox?

I am implementing desktop notifications in a website which displays notifications when new messages arrive. I want the browser tab in which the site is open to get focus when the user clicks on the notification & I could get this worked in Chrome…
Xmindz
  • 1,232
  • 13
  • 33
11
votes
3 answers

Is there a way to display desktop notifications even when Chrome or Firefox is closed?

We're developing a website which sends push notifications to end users using GCM. We've gone through Service Worker and all. We have developed a prototype using this codelab tutorial. It is working so far, but the only issue is the notifications are…
10
votes
2 answers

How to copy web notification content to clipboard

I am using Firebase Cloud Messaging (FCM) to send Data messages so that I can handle notification using Service Worker. Now I show the notification using Service Worker and when I click the notification I want to copy the content of notification in…
Pawan Aichra
  • 371
  • 1
  • 13
9
votes
1 answer

Create web notification with timeout

How do I create a TypeScript web notification with a set timeout? I created the following code but doesn't work in closing the notification before the default timeout: export function createNotification(title: string, body: string) { let now:…
wonea
  • 3,987
  • 17
  • 71
  • 134
9
votes
6 answers

Using Notification API for Electron App

How to implement Notification API on Electron App? I tried checking Notification.permission and it returns granted But when I try to run: new Notification("FOO", {body:"FOOOOOOOOOOOOOOOOOOOOOOOOO"}); nothing happens. Is it even supported?
Jo E.
  • 6,278
  • 11
  • 44
  • 79
8
votes
1 answer

Web Notification push throws 400 from python on Chrome

I am using pywebpush 1.4.0 library to push Web Notifications from Django backend. The keys that I'm using were obtained from https://web-push-codelab.glitch.me/. Subscription seems to working fine. Moreover, I tested this on Firefox and it is…
Avinash Gupta
  • 370
  • 2
  • 14
8
votes
3 answers

Notification.requestPermission throws an error in Mac versions of Safari

I am trying to display notifications with jQuery locally on page load. The notification is showing correctly in Firefox, Firefox Developer, and Chrome. The notification is not appearing in Safari despite allowed in notification preference…
Ahmed
  • 81
  • 1
  • 6
8
votes
1 answer

Notifications across all browsers

Are there any sort of notification system that works with all major browsers? I know chrome has their Notification API, Safari has push notifications and IE has pinned sites but is there some more general way to show notifications? I did find…
Ph33ly
  • 593
  • 2
  • 8
  • 23
7
votes
1 answer

Intercept HTML5 Web Notifications in a browser environment

I would like to intercept HTML5 Web Notifications. I have read the following answer where a user suggests that it is possible to override the window.Notification object with your own object that will act as a proxy. I tried to do that but couldn't…
daljit97
  • 578
  • 10
  • 31
7
votes
2 answers

click_action attribute for web push notification through FCM

My questions is some what similar to (question) but with some differences. I am using FCM Admin SDK, but still do not see an option to send the click_action attribute for Web Push notifications. I checked out…
1
2 3
9 10