summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/modules/wake_lock/wake_lock.idl
blob: 6fd074ad4cd58c11a83ff1badd00b2e012cf0925 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// 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/wake-lock/#the-wakelock-interface
[
  SecureContext,
  Exposed=(DedicatedWorker,Window),
  RuntimeEnabled=WakeLock
] interface WakeLock {
  [CallWith=ScriptState, Exposed=Window] static Promise<PermissionState> requestPermission(WakeLockType type);
  [CallWith=ScriptState] static Promise<void> request(WakeLockType type, optional WakeLockRequestOptions options);
};