enum WakeLockType { "system" };
[SecureContext]
partial interface Navigator {
[SameObject] readonly attribute WakeLock wakeLock;
};
[SecureContext]
partial interface WorkerNavigator {
[SameObject] readonly attribute WakeLock wakeLock;
};
[SecureContext, Exposed=(DedicatedWorker, Window)]
interface WakeLock {
Promise<WakeLockSentinel> request(optional WakeLockType type = "screen");
};
[SecureContext, Exposed=(DedicatedWorker, Window)]
interface WakeLockSentinel : EventTarget {
readonly attribute WakeLockType type;
Promise<void> release();
attribute EventHandler onrelease;
};