[webkit-gtk] Proposed notifications API

Michael Catanzaro mcatanzaro at igalia.com
Sun Nov 20 16:27:19 PST 2016


Hi,

We need a new API to make desktop notifications work properly in
Epiphany. Currently websites are unconditionally informed that they do
not have permission to show notifications, even if a permission request
would be immediately granted. It causes some websites to display UI to
request notification permission unnecessarily. Proposal:

WEBKIT_API void
webkit_web_context_set_initial_notification_permissions
                                                    (WebKitWebContext              *context,
                                                     GHashTable                    *permissions);

https://bugs.webkit.org/show_bug.cgi?id=163366

We also need new API to make it possible for applications that
implement their own desktop notifications (instead of using WebKit's
default libnotify-based implementation, like Epiphany does) to withdraw
an old notification when a new notification with the same tag is shown.
Proposal:

WEBKIT_API const gchar *
webkit_notification_get_tag                  (WebKitNotification *notification);

Plus a new WebKitNotification:tag property.

https://bugs.webkit.org/show_bug.cgi?id=164771

Lastly, we need API for applications that implement their own desktop
notifications to set the image properly. I don't have a patch for this
yet because I'm not sure how to handle the default implementation and I
 think we should do that before exposing API for alternative
implementations, but my proposal is:

WEBKIT_API const gchar *
webkit_notification_get_icon_uri               
   (WebKitNotification *notification);

Plus a new WebKitNotification:icon-uri property.

https://bugs.webkit.org/show_bug.cgi?id=164986

Comments welcome.

Michael


More information about the webkit-gtk mailing list