S
S
Sergey Sokolov2016-04-17 11:25:30
Browsers
Sergey Sokolov, 2016-04-17 11:25:30

Why do web pushes look and behave differently in Firefox and Chrome under OS X?

Notification through Firefox appears in a window with rounded corners,
fc78f5b03d204d4a88f13dbb80789e69.png
disappears after a few seconds and remains in the tray for notifications:
fdc3a63ce0a34d83a75a70e18c4aade0.png
A notification through Chrome appears in some kind of custom window, with sharp corners and X to close, does not disappear by itself and does not leave traces in Notifications tray:
f4dc8017b3464734b7853441c777358b.png
 
Why is that? Don't browsers use a single operating system API to display notifications?
Is it possible for Chrome to use the same "native" mechanism as Firefox (and, probably, Safari - has not connected yet).
Method in service worker to display notifications in all cases:

// ...
self.addEventListener('push', function(event) {
  console.log('Push message received', event);
  var title = 'Deserterio message';
  event.waitUntil(
    self.registration.showNotification( title, {
      body: 'event xxx',
      icon: 'i/150x150.png',
      tag: 'my-tag'
    })
  );
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg Karnaukhov, 2016-04-18
@sergiks

Yes, they use different methods for displaying notifications. In general, chrome has experimental support for native notifications, but the problem is that notifications in chrome are more advanced .
Google calls it Rich Notifications, such notifications can have several buttons, a large picture under the notification, etc. - native OSX notifications don't do that.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question