devtools_panels.json (14836B)
1 [ 2 { 3 "namespace": "devtools.panels", 4 "allowedContexts": ["devtools", "devtools_only"], 5 "defaultContexts": ["devtools", "devtools_only"], 6 "description": "Use the <code>chrome.devtools.panels</code> API to integrate your extension into Developer Tools window UI: create your own panels, access existing panels, and add sidebars.", 7 "nocompile": true, 8 "types": [ 9 { 10 "id": "ElementsPanel", 11 "type": "object", 12 "description": "Represents the Elements panel.", 13 "events": [ 14 { 15 "name": "onSelectionChanged", 16 "type": "function", 17 "description": "Fired when an object is selected in the panel." 18 } 19 ], 20 "functions": [ 21 { 22 "name": "createSidebarPane", 23 "async": "callback", 24 "type": "function", 25 "description": "Creates a pane within panel's sidebar.", 26 "parameters": [ 27 { 28 "name": "title", 29 "type": "string", 30 "description": "Text that is displayed in sidebar caption." 31 }, 32 { 33 "name": "callback", 34 "type": "function", 35 "description": "A callback invoked when the sidebar is created.", 36 "optional": true, 37 "parameters": [ 38 { 39 "name": "result", 40 "description": "An ExtensionSidebarPane object for created sidebar pane.", 41 "$ref": "ExtensionSidebarPane" 42 } 43 ] 44 } 45 ] 46 } 47 ] 48 }, 49 { 50 "id": "SourcesPanel", 51 "type": "object", 52 "description": "Represents the Sources panel.", 53 "events": [ 54 { 55 "name": "onSelectionChanged", 56 "unsupported": true, 57 "description": "Fired when an object is selected in the panel." 58 } 59 ], 60 "functions": [ 61 { 62 "name": "createSidebarPane", 63 "unsupported": true, 64 "type": "function", 65 "description": "Creates a pane within panel's sidebar.", 66 "parameters": [ 67 { 68 "name": "title", 69 "type": "string", 70 "description": "Text that is displayed in sidebar caption." 71 }, 72 { 73 "name": "callback", 74 "type": "function", 75 "description": "A callback invoked when the sidebar is created.", 76 "optional": true, 77 "parameters": [ 78 { 79 "name": "result", 80 "description": "An ExtensionSidebarPane object for created sidebar pane.", 81 "$ref": "ExtensionSidebarPane" 82 } 83 ] 84 } 85 ] 86 } 87 ] 88 }, 89 { 90 "id": "ExtensionPanel", 91 "type": "object", 92 "description": "Represents a panel created by extension.", 93 "functions": [ 94 { 95 "name": "createStatusBarButton", 96 "unsupported": true, 97 "description": "Appends a button to the status bar of the panel.", 98 "type": "function", 99 "parameters": [ 100 { 101 "name": "iconPath", 102 "type": "string", 103 "description": "Path to the icon of the button. The file should contain a 64x24-pixel image composed of two 32x24 icons. The left icon is used when the button is inactive; the right icon is displayed when the button is pressed." 104 }, 105 { 106 "name": "tooltipText", 107 "type": "string", 108 "description": "Text shown as a tooltip when user hovers the mouse over the button." 109 }, 110 { 111 "name": "disabled", 112 "type": "boolean", 113 "description": "Whether the button is disabled." 114 } 115 ], 116 "returns": { "$ref": "Button" } 117 } 118 ], 119 "events": [ 120 { 121 "name": "onSearch", 122 "unsupported": true, 123 "description": "Fired upon a search action (start of a new search, search result navigation, or search being canceled).", 124 "parameters": [ 125 { 126 "name": "action", 127 "type": "string", 128 "description": "Type of search action being performed." 129 }, 130 { 131 "name": "queryString", 132 "type": "string", 133 "optional": true, 134 "description": "Query string (only for 'performSearch')." 135 } 136 ] 137 }, 138 { 139 "name": "onShown", 140 "type": "function", 141 "description": "Fired when the user switches to the panel.", 142 "parameters": [ 143 { 144 "name": "window", 145 "type": "object", 146 "isInstanceOf": "global", 147 "additionalProperties": { "type": "any" }, 148 "description": "The JavaScript <code>window</code> object of panel's page." 149 } 150 ] 151 }, 152 { 153 "name": "onHidden", 154 "type": "function", 155 "description": "Fired when the user switches away from the panel." 156 } 157 ] 158 }, 159 { 160 "id": "ExtensionSidebarPane", 161 "type": "object", 162 "description": "A sidebar created by the extension.", 163 "functions": [ 164 { 165 "name": "setHeight", 166 "unsupported": true, 167 "type": "function", 168 "description": "Sets the height of the sidebar.", 169 "parameters": [ 170 { 171 "name": "height", 172 "type": "string", 173 "description": "A CSS-like size specification, such as <code>'100px'</code> or <code>'12ex'</code>." 174 } 175 ] 176 }, 177 { 178 "name": "setExpression", 179 "async": "callback", 180 "type": "function", 181 "description": "Sets an expression that is evaluated within the inspected page. The result is displayed in the sidebar pane.", 182 "parameters": [ 183 { 184 "name": "expression", 185 "type": "string", 186 "description": "An expression to be evaluated in context of the inspected page. JavaScript objects and DOM nodes are displayed in an expandable tree similar to the console/watch." 187 }, 188 { 189 "name": "rootTitle", 190 "type": "string", 191 "optional": true, 192 "description": "An optional title for the root of the expression tree." 193 }, 194 { 195 "name": "callback", 196 "type": "function", 197 "optional": true, 198 "description": "A callback invoked after the sidebar pane is updated with the expression evaluation results." 199 } 200 ] 201 }, 202 { 203 "name": "setObject", 204 "async": "callback", 205 "type": "function", 206 "description": "Sets a JSON-compliant object to be displayed in the sidebar pane.", 207 "parameters": [ 208 { 209 "name": "jsonObject", 210 "type": "string", 211 "description": "An object to be displayed in context of the inspected page. Evaluated in the context of the caller (API client)." 212 }, 213 { 214 "name": "rootTitle", 215 "type": "string", 216 "optional": true, 217 "description": "An optional title for the root of the expression tree." 218 }, 219 { 220 "name": "callback", 221 "type": "function", 222 "optional": true, 223 "description": "A callback invoked after the sidebar is updated with the object." 224 } 225 ] 226 }, 227 { 228 "name": "setPage", 229 "type": "function", 230 "async": true, 231 "description": "Sets an HTML page to be displayed in the sidebar pane.", 232 "parameters": [ 233 { 234 "name": "path", 235 "$ref": "manifest.ExtensionURL", 236 "description": "Relative path of an extension page to display within the sidebar." 237 } 238 ] 239 } 240 ], 241 "events": [ 242 { 243 "name": "onShown", 244 "type": "function", 245 "description": "Fired when the sidebar pane becomes visible as a result of user switching to the panel that hosts it.", 246 "parameters": [ 247 { 248 "name": "window", 249 "type": "object", 250 "isInstanceOf": "global", 251 "additionalProperties": { "type": "any" }, 252 "description": "The JavaScript <code>window</code> object of the sidebar page, if one was set with the <code>setPage()</code> method." 253 } 254 ] 255 }, 256 { 257 "name": "onHidden", 258 "type": "function", 259 "description": "Fired when the sidebar pane becomes hidden as a result of the user switching away from the panel that hosts the sidebar pane." 260 } 261 ] 262 }, 263 { 264 "id": "Button", 265 "type": "object", 266 "description": "A button created by the extension.", 267 "functions": [ 268 { 269 "name": "update", 270 "unsupported": true, 271 "type": "function", 272 "description": "Updates the attributes of the button. If some of the arguments are omitted or <code>null</code>, the corresponding attributes are not updated.", 273 "parameters": [ 274 { 275 "name": "iconPath", 276 "type": "string", 277 "optional": true, 278 "description": "Path to the new icon of the button." 279 }, 280 { 281 "name": "tooltipText", 282 "type": "string", 283 "optional": true, 284 "description": "Text shown as a tooltip when user hovers the mouse over the button." 285 }, 286 { 287 "name": "disabled", 288 "type": "boolean", 289 "optional": true, 290 "description": "Whether the button is disabled." 291 } 292 ] 293 } 294 ], 295 "events": [ 296 { 297 "name": "onClicked", 298 "unsupported": true, 299 "type": "function", 300 "description": "Fired when the button is clicked." 301 } 302 ] 303 } 304 ], 305 "properties": { 306 "elements": { 307 "$ref": "ElementsPanel", 308 "description": "Elements panel." 309 }, 310 "sources": { 311 "$ref": "SourcesPanel", 312 "description": "Sources panel." 313 }, 314 "themeName": { 315 "type": "string", 316 "description": "The name of the current devtools theme." 317 } 318 }, 319 "functions": [ 320 { 321 "name": "create", 322 "type": "function", 323 "description": "Creates an extension panel.", 324 "async": "callback", 325 "parameters": [ 326 { 327 "name": "title", 328 "type": "string", 329 "description": "Title that is displayed next to the extension icon in the Developer Tools toolbar." 330 }, 331 { 332 "name": "iconPath", 333 "description": "Path of the panel's icon relative to the extension directory, or an empty string to use the default extension icon as the panel icon.", 334 "choices": [ 335 { "type": "string", "enum": [""] }, 336 { "$ref": "manifest.ExtensionURL" } 337 ] 338 }, 339 { 340 "name": "pagePath", 341 "$ref": "manifest.ExtensionURL", 342 "description": "Path of the panel's HTML page relative to the extension directory." 343 }, 344 { 345 "name": "callback", 346 "type": "function", 347 "optional": true, 348 "description": "A function that is called when the panel is created.", 349 "parameters": [ 350 { 351 "name": "panel", 352 "description": "An ExtensionPanel object representing the created panel.", 353 "$ref": "ExtensionPanel" 354 } 355 ] 356 } 357 ] 358 }, 359 { 360 "name": "setOpenResourceHandler", 361 "unsupported": true, 362 "type": "function", 363 "description": "Specifies the function to be called when the user clicks a resource link in the Developer Tools window. To unset the handler, either call the method with no parameters or pass null as the parameter.", 364 "async": "callback", 365 "parameters": [ 366 { 367 "name": "callback", 368 "type": "function", 369 "optional": true, 370 "description": "A function that is called when the user clicks on a valid resource link in Developer Tools window. Note that if the user clicks an invalid URL or an XHR, this function is not called.", 371 "parameters": [ 372 { 373 "name": "resource", 374 "$ref": "devtools.inspectedWindow.Resource", 375 "description": "A $(ref:devtools.inspectedWindow.Resource) object for the resource that was clicked." 376 } 377 ] 378 } 379 ] 380 }, 381 { 382 "name": "openResource", 383 "unsupported": true, 384 "type": "function", 385 "description": "Requests DevTools to open a URL in a Developer Tools panel.", 386 "async": "callback", 387 "parameters": [ 388 { 389 "name": "url", 390 "type": "string", 391 "description": "The URL of the resource to open." 392 }, 393 { 394 "name": "lineNumber", 395 "type": "integer", 396 "description": "Specifies the line number to scroll to when the resource is loaded." 397 }, 398 { 399 "name": "callback", 400 "type": "function", 401 "optional": true, 402 "description": "A function that is called when the resource has been successfully loaded." 403 } 404 ] 405 } 406 ], 407 "events": [ 408 { 409 "name": "onThemeChanged", 410 "type": "function", 411 "description": "Fired when the devtools theme changes.", 412 "parameters": [ 413 { 414 "name": "themeName", 415 "type": "string", 416 "description": "The name of the current devtools theme." 417 } 418 ] 419 } 420 ] 421 } 422 ]