Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 1 KB

IDL.md

File metadata and controls

31 lines (25 loc) · 1 KB

Proposed WebIDL

Definition of Trigger and TimestampTrigger

[Exposed=(Window,Worker), SecureContext]
interface Trigger {
  readonly attribute USVString type;
};

[Constructor(DOMTimeStamp timestamp), Exposed=(Window,Worker), SecureContext]
interface TimestampTrigger : Trigger {
  readonly attribute DOMTimeStamp timestamp;
};

Additions to the Notification API

partial dictionary NotificationOptions {
  Trigger showTrigger = null;
};

partial dictionary GetNotificationOptions {
  boolean includeTriggered = false;
};

partial interface Notification {
  [SameObject] readonly attribute Trigger showTrigger;
}

The create a notification algorithm will be amended to throw a TypeError exception when a showTrigger has been provided, but not a serviceWorkerRegistration. This removes the ability to use notification triggers for non-persistent notifications, which inherently are tied to the lifetime of the document.