Google Chrome is finally cracking down on websites abusing push notifications. Chrome is adding a new feature #Push-Subscription-With-Expiration-Time behind chrome://flags that will limit push notification subscriptions to 90 days, TheWindowsClub has learned. This flag will enable Push Subscriptions to support an expiration time.
Chrome addressing notifications abuse
At the time of writing this article, this flag is not available in the updated Chrome Canary. But as per Chromium Gerrit commit, it has been successfully rebased and submitted to the updated Google Chrome Canary 86. Perhaps the work is still in progress and we can expect this experimental feature flag to be implemented to future Chrome Canary builds in the coming days.
“This CL enables Push Subscriptions to support a expiration time, set by Chrome in push_messaging_constants.h (currently 90 days),” the description reads.
“This feature is disabled by default, so to try it out you must set –enable-features= PushSubscriptionWithExpirationTime.”
According to Chromium developers, this will add expiration time (90 days) when subscribing to push notifications and in the subscribe method itself. This particular feature will Pass expiration time attribute to blink.
“The expirationTime attribute will be generated through the push service. When getting it back in the SubscriptionCallback (null is valid), it needs to be passed down to the blink layer.”
Chrome is likely to implement certain UI changes that will prompt users to set their push notification subscription to expire after a specific period. It remains to be seen whether or not users can customize the time frame. First things first, it looks like this feature will clearly communicate subscription expiry when push notifications are subscribed for the first time.
There are several parties involved in the entire process. Once users subscribe to notifications, information about subscription expiry will be retrieved from the app_identifier and sent back as a callback to PushMessagingManager. Chrome will store expiration time in PushMessagingAppIdentifier. However, this has not been implemented yet. That said, this feature is actively under development.
Once this flag is available, you can enable it on Google Chrome Canary.
How to enable the Push Subscription With Expiration Time flag in Chrome
- Open Chrome Canary
- Open chrome://flags
- Locate Push Subscription With Expiration Time
- Set the flag to Enable immediately when a tab is hidden using the drop-down menu
- Relaunch Chrome.
To summarize, this feature will add expiry to subscriptions at the time of subscribing to notifications. Meanwhile, Chrome has to decide where to save expiration time on the user agent side. Well, this feature will be optional and it will be up to users to decide whether or not they want their push subscriptions to expire after 90 days.
Chromium developers have been actively working on this feature since last month. TheWindowsClub has spotted several Chromium Gerrit commits that confirm the development.
We will update this article as soon as this experimental feature flag #Push-Subscription-With-Expiration-Time is available under chrome://flags.