OLD | NEW |
(Empty) | |
| 1 [ |
| 2 { |
| 3 "namespace": "windows", |
| 4 "compile": true, |
| 5 "types": [ |
| 6 { |
| 7 "id": "Window", |
| 8 "type": "object", |
| 9 "properties": { |
| 10 "id": {"type": "integer", "minimum": 0, "description": "The ID of the
window. Window IDs are unique within a browser session."}, |
| 11 "focused": {"type": "boolean", "description": "Whether the window is c
urrently the focused window."}, |
| 12 "top": {"type": "integer", "description": "The offset of the window fr
om the top edge of the screen in pixels."}, |
| 13 "left": {"type": "integer", "description": "The offset of the window f
rom the left edge of the screen in pixels."}, |
| 14 "width": {"type": "integer", "description": "The width of the window i
n pixels."}, |
| 15 "height": {"type": "integer", "description": "The height of the window
in pixels."}, |
| 16 "tabs": {"type": "array", "items": { "$ref": "Tab" }, "optional": true
, "description": "Array of $ref:Tab objects representing the current tabs in the
window."}, |
| 17 "incognito": {"type": "boolean", "description": "Whether the window is
incognito."}, |
| 18 "type": { |
| 19 "type": "string", |
| 20 "description": "The type of browser window this is.", |
| 21 "enum": ["normal", "popup", "panel", "app"] |
| 22 }, |
| 23 "state": { |
| 24 "type": "string", |
| 25 "description": "The state of this browser window.", |
| 26 "enum": ["normal", "minimized", "maximized"] |
| 27 } |
| 28 } |
| 29 } |
| 30 ], |
| 31 "properties": { |
| 32 "WINDOW_ID_NONE": { |
| 33 "type": "integer", |
| 34 "value": "-1", |
| 35 "description": "The windowId value that represents the absence of a chro
me browser window." |
| 36 } |
| 37 }, |
| 38 "functions": [ |
| 39 { |
| 40 "name": "get", |
| 41 "type": "function", |
| 42 "description": "Gets details about a window.", |
| 43 "parameters": [ |
| 44 {"type": "integer", "name": "windowId", "minimum": 0}, |
| 45 { |
| 46 "type": "object", |
| 47 "name": "getInfo", |
| 48 "optional": true, |
| 49 "description": "", |
| 50 "properties": { |
| 51 "populate": {"type": "boolean", "optional": true, "description": "
If true, the window object will have a <var>tabs</var> property that contains a
list of the $ref:Tab objects" } |
| 52 } |
| 53 }, |
| 54 { |
| 55 "type": "function", |
| 56 "name": "callback", |
| 57 "parameters": [ |
| 58 { |
| 59 "name": "window", "$ref": "Window" |
| 60 } |
| 61 ] |
| 62 } |
| 63 ] |
| 64 }, |
| 65 { |
| 66 "name": "getCurrent", |
| 67 "type": "function", |
| 68 "description": "Gets the <a href='#current-window'>current window</a>.", |
| 69 "parameters": [ |
| 70 { |
| 71 "type": "object", |
| 72 "name": "getInfo", |
| 73 "optional": true, |
| 74 "description": "", |
| 75 "properties": { |
| 76 "populate": {"type": "boolean", "optional": true, "description": "
If true, the window object will have a <var>tabs</var> property that contains a
list of the $ref:Tab objects" } |
| 77 } |
| 78 }, |
| 79 { |
| 80 "type": "function", |
| 81 "name": "callback", |
| 82 "parameters": [ |
| 83 { |
| 84 "name": "window", "$ref": "Window" |
| 85 } |
| 86 ] |
| 87 } |
| 88 ] |
| 89 }, |
| 90 { |
| 91 "name": "getLastFocused", |
| 92 "type": "function", |
| 93 "description": "Gets the window that was most recently focused — t
ypically the window 'on top'.", |
| 94 "parameters": [ |
| 95 { |
| 96 "type": "object", |
| 97 "name": "getInfo", |
| 98 "optional": true, |
| 99 "description": "", |
| 100 "properties": { |
| 101 "populate": {"type": "boolean", "optional": true, "description": "
If true, the window object will have a <var>tabs</var> property that contains a
list of the $ref:Tab objects" } |
| 102 } |
| 103 }, |
| 104 { |
| 105 "type": "function", |
| 106 "name": "callback", |
| 107 "parameters": [ |
| 108 { |
| 109 "name": "window", "$ref": "Window" |
| 110 } |
| 111 ] |
| 112 } |
| 113 ] |
| 114 }, |
| 115 { |
| 116 "name": "getAll", |
| 117 "type": "function", |
| 118 "description": "Gets all windows.", |
| 119 "parameters": [ |
| 120 { |
| 121 "type": "object", |
| 122 "name": "getInfo", |
| 123 "optional": true, |
| 124 "description": "", |
| 125 "properties": { |
| 126 "populate": {"type": "boolean", "optional": true, "description": "
If true, each window object will have a <var>tabs</var> property that contains a
list of the $ref:Tab objects for that window." } |
| 127 } |
| 128 }, |
| 129 { |
| 130 "type": "function", |
| 131 "name": "callback", |
| 132 "parameters": [ |
| 133 { |
| 134 "name": "windows", "type": "array", "items": { "$ref": "Window"
} |
| 135 } |
| 136 ] |
| 137 } |
| 138 ] |
| 139 }, |
| 140 { |
| 141 "name": "create", |
| 142 "type": "function", |
| 143 "description": "Creates (opens) a new browser with any optional sizing,
position or default URL provided.", |
| 144 "parameters": [ |
| 145 { |
| 146 "type": "object", |
| 147 "name": "createData", |
| 148 "properties": { |
| 149 "url": { |
| 150 "type": "string", |
| 151 "description": "A URL or list of URLs to open as tabs in the win
dow. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', n
ot 'www.google.com'). Relative URLs will be relative to the current page within
the extension. Defaults to the New Tab Page.", |
| 152 "optional": true, |
| 153 "choices": [ |
| 154 {"type": "string"}, |
| 155 {"type": "array", "items": {"type": "string"}} |
| 156 ] |
| 157 }, |
| 158 "tabId": {"type": "integer", "minimum": 0, "optional": true, "desc
ription": "The id of the tab for which you want to adopt to the new window."}, |
| 159 "left": {"type": "integer", "optional": true, "description": "The
number of pixels to position the new window from the left edge of the screen. If
not specified, the new window is offset naturally from the last focusd window.
This value is ignored for panels."}, |
| 160 "top": {"type": "integer", "optional": true, "description": "The n
umber of pixels to position the new window from the top edge of the screen. If n
ot specified, the new window is offset naturally from the last focusd window. Th
is value is ignored for panels."}, |
| 161 "width": {"type": "integer", "minimum": 0, "optional": true, "desc
ription": "The width in pixels of the new window. If not specified defaults to a
natural width."}, |
| 162 "height": {"type": "integer", "minimum": 0, "optional": true, "des
cription": "The height in pixels of the new window. If not specified defaults to
a natural height."}, |
| 163 "focused": {"type": "boolean", "optional": true, "description": "I
f true, opens an active window. If false, opens an inactive window."}, |
| 164 "incognito": {"type": "boolean", "optional": true, "description":
"Whether the new window should be an incognito window."}, |
| 165 "type": { |
| 166 "type": "string", |
| 167 "optional": true, |
| 168 "description": "Specifies what type of browser window to create.
The 'panel' type creates a popup unless the '--enable-panels' flag is set.", |
| 169 "enum": ["normal", "popup", "panel"] |
| 170 } |
| 171 }, |
| 172 "optional": true |
| 173 }, |
| 174 { |
| 175 "type": "function", |
| 176 "name": "callback", |
| 177 "optional": true, |
| 178 "parameters": [ |
| 179 { |
| 180 "name": "window", "$ref": "Window", "description": "Contains det
ails about the created window.", |
| 181 "optional": true |
| 182 } |
| 183 ] |
| 184 } |
| 185 ] |
| 186 }, |
| 187 { |
| 188 "name": "update", |
| 189 "type": "function", |
| 190 "description": "Updates the properties of a window. Specify only the pro
perties that you want to change; unspecified properties will be left unchanged."
, |
| 191 "parameters": [ |
| 192 {"type": "integer", "name": "windowId", "minimum": 0}, |
| 193 { |
| 194 "type": "object", |
| 195 "name": "updateInfo", |
| 196 "properties": { |
| 197 "left": {"type": "integer", "optional": true, "description": "The
offset from the left edge of the screen to move the window to in pixels. This va
lue is ignored for panels."}, |
| 198 "top": {"type": "integer", "optional": true, "description": "The o
ffset from the top edge of the screen to move the window to in pixels. This valu
e is ignored for panels."}, |
| 199 "width": {"type": "integer", "minimum": 0, "optional": true, "desc
ription": "The width to resize the window to in pixels. This value is ignored fo
r panels."}, |
| 200 "height": {"type": "integer", "minimum": 0, "optional": true, "des
cription": "The height to resize the window to in pixels. This value is ignored
for panels."}, |
| 201 "focused": {"type": "boolean", "optional": true, "description": "I
f true, brings the window to the front. If false, brings the next window in the
z-order to the front."}, |
| 202 "drawAttention": {"type": "boolean", "optional": true, "descriptio
n": "If true, causes the window to be displayed in a manner that draws the user'
s attention to the window, without changing the focused window. The effect lasts
until the user changes focus to the window. This option has no effect if set to
false or if the window already has focus."}, |
| 203 "state": { |
| 204 "type": "string", |
| 205 "optional": true, |
| 206 "description": "The new state of the window. The 'minimized' and
'maximized' states cannot be combined with 'left', 'top', 'width' or 'height'."
, |
| 207 "enum": ["normal", "minimized", "maximized"] |
| 208 } |
| 209 } |
| 210 }, |
| 211 { |
| 212 "type": "function", |
| 213 "name": "callback", |
| 214 "optional": true, |
| 215 "parameters": [ |
| 216 { |
| 217 "name": "window", "$ref": "Window" |
| 218 } |
| 219 ] |
| 220 } |
| 221 ] |
| 222 }, |
| 223 { |
| 224 "name": "remove", |
| 225 "type": "function", |
| 226 "description": "Removes (closes) a window, and all the tabs inside it.", |
| 227 "parameters": [ |
| 228 {"type": "integer", "name": "windowId", "minimum": 0}, |
| 229 {"type": "function", "name": "callback", "optional": true, "parameters
": []} |
| 230 ] |
| 231 } |
| 232 ], |
| 233 "events": [ |
| 234 { |
| 235 "name": "onCreated", |
| 236 "type": "function", |
| 237 "description": "Fired when a window is created.", |
| 238 "parameters": [ |
| 239 { |
| 240 "$ref": "Window", |
| 241 "name": "window", |
| 242 "description": "Details of the window that was created." |
| 243 } |
| 244 ] |
| 245 }, |
| 246 { |
| 247 "name": "onRemoved", |
| 248 "type": "function", |
| 249 "description": "Fired when a window is removed (closed).", |
| 250 "parameters": [ |
| 251 {"type": "integer", "name": "windowId", "minimum": 0, "description": "
ID of the removed window."} |
| 252 ] |
| 253 }, |
| 254 { |
| 255 "name": "onFocusChanged", |
| 256 "type": "function", |
| 257 "description": "Fired when the currently focused window changes. Will be
chrome.windows.WINDOW_ID_NONE if all chrome windows have lost focus. Note: On s
ome Linux window managers, WINDOW_ID_NONE will always be sent immediately preced
ing a switch from one chrome window to another.", |
| 258 "parameters": [ |
| 259 {"type": "integer", "name": "windowId", "minimum": -1, "description":
"ID of the newly focused window."} |
| 260 ] |
| 261 } |
| 262 ] |
| 263 } |
| 264 ] |
OLD | NEW |