Bug 164986

Summary: [GTK] Notifications API does not respect or expose the "icon" attribute
Product: WebKit Reporter: Michael Catanzaro <mcatanzaro>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: aperez, bugs-noreply, mcatanzaro
Priority: P2    
Version: WebKit Nightly Build   
Hardware: PC   
OS: Linux   
See Also: https://bugs.webkit.org/show_bug.cgi?id=164771

Description Michael Catanzaro 2016-11-19 07:27:14 PST
Our web notifications do not display the icons set by webpages.
Comment 1 Michael Catanzaro 2016-11-19 12:51:50 PST
Hm, it's not straightforward. We have a URI in the UI process, and have to send it to the network process (so that the right proxy settings get used), download the resource there, pass the bytes back to the UI process, and create a GdkPixbuf there. I guess it has to happen asynchronously in WebKitNotificationProvider::show. The NotifyNotification should not be created until the image is ready.
Comment 2 Michael Catanzaro 2017-02-04 11:20:07 PST
Let's start for now with just exposing the property, so it will at least be *possible* for apps to show web notifications with icons, even if WebKit-created notifications don't have icons yet.
Comment 3 Adrian Perez 2017-02-04 16:46:20 PST
(In reply to comment #2)
> Let's start for now with just exposing the property, so it will at least be
> *possible* for apps to show web notifications with icons, even if
> WebKit-created notifications don't have icons yet.

This seems reasonable, because anyway it would be unclear which icon
WebKitGTK+ would use when one is not explicitly defined. I would rather
not have a default fallback icon that trying to guess “too much” and end
up with heuristics. An application which wants to add their own icon may
be better off by connecting to the “WebKitWebView::show-notification”
signal, using a GNotification instead to add the icon (and probably more),
and finally preventing the WebKitGTK+ generic notification. The following
example shows that this is really easy to do:

  https://github.com/aperezdc/revolt/blob/master/revolt/window.py#L142-L158

(Which makes me think: maybe we want to do something like that in Epiphany!)
Comment 4 Adrian Perez 2017-02-04 16:47:40 PST
(In reply to comment #3)
> […] I would rather not have a default fallback icon that trying to guess […]
                                                      ^^^^
                                                      than