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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
|
// 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": "runtime",
"documentation_permissions_required": ["runtime"],
"properties": {
"lastError": {
"type": "object",
"optional": true,
"description": "This will be defined during an API method callback if there was an error",
"unprivileged": true,
"properties": {
"message": {
"optional": true,
"type": "string",
"description": "Details about the error which occurred."
}
}
},
"id": {
"type": "string",
"description": "The ID of the extension/app.",
"unprivileged": true
}
},
"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 an event page, 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."
}
]
}
]
},
{
"name": "getManifest",
"description": "Returns details about the app or extension from the manifest. The object returned is a serialization of the full <a href=\"manifest.html\">manifest file</a>.",
"type": "function",
"unprivileged": true,
"parameters": [],
"returns": {
"type": "object",
"properties": {},
"additionalProperties": { "type": "any" },
"description": "The manifest details."
}
},
{
"name": "getURL",
"type": "function",
"unprivileged": true,
"description": "Converts a relative path within an app/extension install directory to a fully-qualified URL.",
"parameters": [
{
"type": "string",
"name": "path",
"description": "A path to a resource within an app/extension expressed relative to its install directory."
}
],
"returns": {
"type": "string",
"description": "The fully-qualified URL to the resource."
}
},
{
"name": "reload",
"description": "Reloads the app or extension.",
"type": "function",
"unprivileged": true,
"parameters": []
}
],
"events": [
{
"name": "onStartup",
"type": "function",
"description": "Fired when the browser first starts up."
},
{
"name": "onInstalled",
"type": "function",
"description": "Fired when the extension is first installed, when the extension is updated to a new version, and when Chrome is updated to a new version.",
"parameters": [
{
"type": "object",
"name": "details",
"properties": {
"reason": {
"type": "string",
"enum": ["install", "update", "chrome_update"],
"description": "The reason that this event is being dispatched."
},
"previousVersion": {
"type": "string",
"optional": true,
"description": "Indicates the previous version of the extension, which has just been updated. This is present only if 'reason' is 'update'."
}
}
}
]
},
{
"name": "onSuspend",
"type": "function",
"description": "Sent to the event 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. If more activity for the event page occurs before it gets unloaded the onSuspendCanceled event will be sent and the page won't be unloaded. "
},
{
"name": "onSuspendCanceled",
"type": "function",
"description": "Sent after onSuspend() to indicate that the app won't be unloaded after all."
},
{
"name": "onUpdateAvailable",
"type": "function",
"description": "Fired when an update is available, but isn't installed immediately because the app is currently running. If you do nothing, the update will be installed the next time the background page gets unloaded, if you want it to be installed sooner you can explicitly call chrome.runtime.reload().",
"parameters": [
{
"type": "object",
"name": "details",
"properties": {
"version": {
"type": "string",
"description": "The version number of the available update."
}
},
"additionalProperties": { "type": "any" },
"description": "The manifest details of the available update."
}
]
}
]
}
]
|