[whatwg] Notifications: createTime property

Michael Henretty michael.henretty at gmail.com
Fri Feb 14 14:25:35 PST 2014

I apologize if this has already been discussed before (I couldn't find
anything in the archives).

It would be extremely useful to have a timestamp property, perhaps
`createTime`, that would get added to the notification object by the
platform when calling `new Notification`. A use case I have in mind is when
a content process wants to manually expire notifications of a certain age,
but did not itself create the original notification and so has no insight
into its age. This would be the case if, for example, the expiration logic
lived in a worker, a different window of the same origin, or in an app that
got killed at some point after calling `new`.

Also, most (if not all) platforms will timestamp the notification message
anyway for use in its display. Here it would be nice if both the platform
and originating content had access to this same timestamp data, so that any
displayed dates or date logic could be in sync.

Are there drawbacks/complexities I'm not thinking about here?

Michael Henretty

More information about the whatwg mailing list