WordPress.com Launches Browser Notifications

browser-notifications-firefox

WordPress.com launched browser notifications this week, a feature that delivers instant notifications of site activity to Chrome and Firefox users. Notifications are opt-in, so users will need to enable them before they will be active. Fortunately, they are also configurable on a per-site and per-activity basis, otherwise users with a larger volume of notifications might be overloaded.

configure-notifications

“Browser notifications give you a real-time sense of your readers’ reactions, allowing you to stay more engaged with your audience,” said Matt Sherman, one of Automattic’s JavaScript engineers who worked on the feature.

The WordPress mobile apps have had push notifications in place for several years. Sherman said the new browser notifications build on the existing mobile push notifications codebase in WordPress.com, since they share many common features. He explained how they work:

Browser notifications work similar to mobile push notifications. We support the W3C Push API standard, which is currently implemented by recent versions of Chrome and Firefox. When we send a browser notification, we encrypt the data and issue a request to Google’s or Mozilla’s server. Their servers deliver the encrypted notification data to the user’s web browser, where it is decrypted and displayed to the user.

The notifications work even when users don’t have WordPress.com open in their browsers, thanks to Service Workers that use background processing to give notice of activity from WordPress.com. The feature is meant to increase engagement between WordPress.com users and their audiences.

Browser notifications are also available for Jetpack-connected sites and can be configured on WordPress.com. Sherman said since the network already handles this type of activity from Jetpack-connected sites, WordPress.com can build on top of that to offer another notification option for users.

I asked Sherman if Automattic plans to open source the code for browser notifications on its GitHub account, and he said that the front-end and service worker code is already available in the wp-calypso repository. The team has no immediate plans to make the backend code available but Sherman recommends developers check out existing open source options, such as the PHP-based Web Push library, for delivering browser notifications.