You are viewing extension docs in chrome via the 'file:' scheme: are you expecting to see local changes when you refresh? You'll need run chrome with --allow-file-access-from-files.
paramName
( optional enumerated Type array of paramType )
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.
Parameters

Google Chrome Extensions (Labs)

chrome.experimental.devtools.panels

For information on how to use experimental APIs, see the chrome.experimental.* APIs page.

Use the chrome.experimental.devtools.panels module to integrate your extension into Developer Tools window UI: create your own panels, access existing panels and add sidebars.

See DevTools APIs summary for general introduction to using Developer Tools APIs.

Notes

Each extension panel and sidebar is displayed as a separate HTML page. All extension pages displayed in the Developer Tools window have access to all modules in chrome.experimental.devtools API, as well as to chrome.extension API. Other extension APIs are not available to the pages within Developer Tools window, but you may invoke them by sending a request to the background page of your extension, similarly to how it's done in the content scripts.

Examples

The following code adds a panel contained in Panel.html, represented by FontPicker.png on the Developer Tools toolbar and labeled as Font Picker:

chrome.experimental.devtools.panels.create("Font Picker",
                                           "FontPicker.png",
                                           "Panel.html"
                                           function(panel) { ... });

The following code adds a sidebar pane contained in Sidebar.html and titled Font Properties to the Elements panel, then sets its height to 8ex:

chrome.experimental.devtools.panels.elements.createSidebarPane("Font Properties",
    function(sidebar) {
      sidebar.setPage("Sidebar.html");
      sidebar.setHeight("8ex");
    });

This screenshot demonstrates the effect the above examples would have on Developer Tools window: Extension icon panel on DevTools toolbar

You can find examples that use this API in Samples.

API reference: chrome.experimental.devtools.panels

Properties

elements

chrome.experimental.devtools.panels.elements
elements
( ElementsPanel array of paramType )
Elements panel.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

Methods

create

void chrome.experimental.devtools.panels.create(, string title, string iconURL, string pageURL, function callback)

Creates an extension panel.

Parameters

title
( Type array of string )
Title that is displayed under the extension icon in the toolbar.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.
iconURL
( Type array of string )
A URL of the toolbar icon.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.
pageURL
( Type array of string )
A URL of the page that represents this panel.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.
callback
( Type array of function )
A function that is called upon request completion.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

Returns

Callback function

The callback parameter should specify a function that looks like this:

If you specify the callback parameter, it should specify a function that looks like this:

function(ExtensionPanel panel) {...};
panel
( ExtensionPanel array of paramType )
An ExtensionPanel object representing the created panel.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

This function was added in version . If you require this function, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

Types

PanelWithSidebars

paramName
( Type array of Panel )
A panel within Web Inspector UI that has sidebars.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

Methods of PanelWithSidebars

createSidebarPane

void panelWithSidebars.createSidebarPane(, string title, function callback)

Creates a pane within panel's sidebar.

Parameters

title
( Type array of string )
A text that is displayed in sidebar caption.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.
callback
( Type array of function )
A callback invoked when sidebar is created.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

Returns

Callback function

The callback parameter should specify a function that looks like this:

If you specify the callback parameter, it should specify a function that looks like this:

function(ExtensionSidebarPane result) {...};
result
( ExtensionSidebarPane array of paramType )
An ExtensionSidebarPane object for created sidebar pane.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

This function was added in version . If you require this function, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

ElementsPanel

paramName
( Type array of PanelWithSidebars )
Represents Elements panel
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

Events of ElementsPanel

onSelectionChanged

elementsPanel.onSelectionChanged.addListener(function() {...});

Fired when an object is selected in the panel.

Listener parameters

Extra parameters to addListener

Listener returns

ExtensionPanel

paramName
( Type array of Panel )
Represents a panel created by extension.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

Events of ExtensionPanel

onSearch

extensionPanel.onSearch.addListener(function(string action, string queryString) {...});

Fired upon a search action (start of a new search, search result navigation or search being canceled).

Listener parameters

action
( Type array of string )
Type of search action being performed.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.
queryString
( optional Type array of string )
Query string (only for 'performSearch').
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

Extra parameters to addListener

Listener returns

ExtensionSidebarPane

paramName
( Type array of object )
A sidebar created by the extension.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

Methods of ExtensionSidebarPane

setExpression

void extensionSidebarPane.setExpression(, string expression, string rootTitle)

Sets an expression that is evaluated within the inspected page. The result is displayed in the sidebar pane.

Parameters

expression
( Type array of string )
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.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.
rootTitle
( optional Type array of string )
An optional title for the root of the expression tree.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

Returns

Callback function

The callback parameter should specify a function that looks like this:

If you specify the callback parameter, it should specify a function that looks like this:

function(ExtensionPanel panel) {...};
panel
( ExtensionPanel array of paramType )
An ExtensionPanel object representing the created panel.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

This function was added in version . If you require this function, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

setHeight

void extensionSidebarPane.setHeight(, string height)

Sets the height of the sidebar.

Parameters

height
( Type array of string )
A CSS-like size specification, e.g. '10px' or '12pt'.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

Returns

Callback function

The callback parameter should specify a function that looks like this:

If you specify the callback parameter, it should specify a function that looks like this:

function(ExtensionPanel panel) {...};
panel
( ExtensionPanel array of paramType )
An ExtensionPanel object representing the created panel.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

This function was added in version . If you require this function, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

setObject

void extensionSidebarPane.setObject(, string jsonObject, string rootTitle)

Sets a JSON-compliant object to be displayed in the sidebar pane.

Parameters

jsonObject
( Type array of string )
An object to be displayed in context of the inspected page. Evaluated in the context of the caller (API client).
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.
rootTitle
( optional Type array of string )
An optional title for the root of the expression tree.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

Returns

Callback function

The callback parameter should specify a function that looks like this:

If you specify the callback parameter, it should specify a function that looks like this:

function(ExtensionPanel panel) {...};
panel
( ExtensionPanel array of paramType )
An ExtensionPanel object representing the created panel.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

This function was added in version . If you require this function, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

setPage

void extensionSidebarPane.setPage(, string url)

Sets an HTML page to be displayed in the sidebar pane.

Parameters

url
( Type array of string )
A URL of an extension page to display within the sidebar.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

Returns

Callback function

The callback parameter should specify a function that looks like this:

If you specify the callback parameter, it should specify a function that looks like this:

function(ExtensionPanel panel) {...};
panel
( ExtensionPanel array of paramType )
An ExtensionPanel object representing the created panel.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

This function was added in version . If you require this function, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.