// Copyright 2018 The Chromium Authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style license that can be | |
// found in the LICENSE file. | |
enum WakeLockType { | |
"screen", | |
"system" | |
}; | |
// https://w3c.github.io/screen-wake-lock/#the-wakelock-interface | |
[ | |
SecureContext, | |
Exposed(DedicatedWorker SystemWakeLock, Window WakeLock) | |
] interface WakeLock { | |
[CallWith=ScriptState, RaisesException] Promise<WakeLockSentinel> request(optional WakeLockType type = "screen"); | |
}; |