chromium/third_party/blink/renderer/modules/service_worker/client.idl

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// https://wicg.github.io/page-lifecycle/#serviceworker-clients-dfn
enum ClientLifecycleState {
    "active",
    "frozen"
};

// https://w3c.github.io/ServiceWorker/#client-interface
[
    Exposed=ServiceWorker,
    ImplementedAs=ServiceWorkerClient
] interface Client {
    readonly attribute USVString url;
    readonly attribute DOMString id;
    readonly attribute ClientType type;
    [CallWith=ScriptState, RaisesException] void postMessage(any message, sequence<object> transfer);
    [CallWith=ScriptState, RaisesException] void postMessage(any message, optional PostMessageOptions options = {});

    // FIXME: frameType is non-standard, see https://crbug.com/697110
    [CallWith=ScriptState] readonly attribute ContextFrameType frameType;

    [RuntimeEnabled=ServiceWorkerClientLifecycleState] readonly attribute ClientLifecycleState lifecycleState;
};