summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/api/experimental_runtime.json
blob: ad371601c9b6d8cfa43a40bc6e8317f367591761 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright (c) 2012 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.

[
  {
    "namespace": "experimental.runtime",
    "functions": [
      {
        "name": "getBackgroundPage",
        "type": "function",
        "description": "Retrieves the JavaScript 'window' object for the background page running inside the current extension. If the background page is transient, the system will ensure it is loaded before calling the callback. If there is no background page, an error is set.",
        "parameters": [
          {
            "type": "function",
            "name": "callback",
            "parameters": [
              {
                "name": "backgroundPage",
                // Note: Only optional because we don't support validation
                // for custom callbacks.
                "optional": true,
                "type": "object",
                "isInstanceOf": "global",
                "additionalProperties": { "type": "any" },
                "description": "The JavaScript 'window' object for the background page."
              }
            ]
          }
        ]
      }
    ],
    "events": [
      {
        "name": "onInstalled",
        "type": "function",
        "description": "Fired when the extension is first installed."
      },
      {
        "name": "onBackgroundPageUnloadingSoon",
        "type": "function",
        "description": "Sent to the transient background page just before it is unloaded. This gives the extension opportunity to do some clean up. Note that since the page is unloading, any asynchronous operations started while handling this event are not guaranteed to complete."
      }
    ]
  }
]