Skip to content

Instantly share code, notes, and snippets.

@domenic
Forked from mounirlamouri/gist:8a823ce60a31d926d4da
Last active August 29, 2015 14:18
Show Gist options
  • Save domenic/db44ae9dd73534d63e46 to your computer and use it in GitHub Desktop.
Save domenic/db44ae9dd73534d63e46 to your computer and use it in GitHub Desktop.
interface PermissionStatus : EventTarget {
readonly attribute PermissionState status;
attribute EventHandler onchange;
};
interface Permissions {
readonly attribute GeolocationPermission geolocation;
readonly attribute MidiPermission midi;
readonly attribute NotificationsPermission notifications;
readonly attribute PushPermission push;
};
// Geolocation
interface GeolocationPermission {
Promise<PermissionStatus> query();
};
// Midi
dictionary MidiPermissionOptions {
boolean sysex = false;
};
interface MidiPermission {
Promise<PermissionStatus> query(optional MidiPermissionOptions options);
};
// Notifications
interface NotificationsPermission {
Promise<PermissionStatus> query();
};
// Push
dictionary PushPermissionOptions {
boolean userVisible = false;
};
interface PushPermission {
Promise<PermissionStatus> query(optional PushPermissionOptions options);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment