experimental.webInspector.panels
For information on how to use experimental APIs, see the chrome.experimental.* APIs page.
Use the experimental.webInspector.panels
module to integrate your
extension into Developer Tools window UI: create your own panels, access
existing panels and add sidebars.
See WebInspector API summary for
general introduction to using WebInspector API.
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 experimental.webInspector
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:
webInspector.panels.create("Font Picker", "FontPicker.png", "Panel.html");
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
:
webInspector.panels.elements.createSidebarPane("Font Properties", "Sidebar.html",
function(sidebar) {
sidebar.setHeight("8ex");
}
}));
This screenshot demonstrates the effect the above examples would have on
Developer Tools window:
API reference: experimental.webInspector.panels
Properties
scripts
experimental.webInspector.panels.scripts
scripts
Undocumented.
Scripts 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
ExtensionPanel
experimental.webInspector.panels.create(, string
title, string
iconURL, string
pageURL)
Undocumented.
Creates an extension panel.
Parameters
-
title
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- 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
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- An 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
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- An 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.
-
-
-
-
Returns
-
paramName
-
Undocumented.
- A panel that was 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.
-
-
-
-
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(Type param1, Type param2) {...};
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.
Events
event name
chrome.bookmarksonEvent.addListener(function(Type param1, Type param2) {...});
Undocumented.
A description from the json schema def of the event goes here.
Types
PanelWithSidebars
paramName
(
optional
enumerated
Type
array of
Panel
)
Undocumented.
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
ExtensionPanel
panelWithSidebars.createSidebarPane(, string
title, string
url, function
callback)
Undocumented.
Creates a pane within panel's sidebar.
Parameters
-
title
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- 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.
-
-
-
-
-
url
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- An URL of the page that represents 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.
-
-
-
-
-
callback
(
optional
enumerated
Type
array of
function
)
-
Undocumented.
- 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
-
paramName
-
Undocumented.
- A panel that was 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.
-
-
-
-
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
-
Undocumented.
- 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.
createWatchExpressionSidebarPane
ExtensionPanel
panelWithSidebars.createWatchExpressionSidebarPane(, string
title, function
callback)
Undocumented.
Creates a pane with an object property tree (similar to a watch sidebar pane).
Parameters
-
title
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- 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
(
optional
enumerated
Type
array of
function
)
-
Undocumented.
- 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
-
paramName
-
Undocumented.
- A panel that was 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.
-
-
-
-
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(WatchExpressionSidebarPane result) {...};
-
result
-
Undocumented.
- A WatchExpressionSidebarPane 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
(
optional
enumerated
Type
array of
PanelWithSidebars
)
Undocumented.
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() {...});
Undocumented.
Fired when an objects is selected in the panel.
ExtensionPanel
paramName
(
optional
enumerated
Type
array of
Panel
)
Undocumented.
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) {...});
Undocumented.
Fired upon a search action (start of a new search, search result navigation or search being canceled).
Parameters
-
action
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- 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
enumerated
Type
array of
string
)
-
Undocumented.
- 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.
-
-
-
-
ExtensionSidebarPane
paramName
(
optional
enumerated
Type
array of
object
)
Undocumented.
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
setHeight
ExtensionPanel
extensionSidebarPane.setHeight(, string
height)
Undocumented.
Sets the height of the sidebar.
Parameters
-
height
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- 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
-
paramName
-
Undocumented.
- A panel that was 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.
-
-
-
-
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(Type param1, Type param2) {...};
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.
WatchExpressionSidebarPane
paramName
(
optional
enumerated
Type
array of
object
)
Undocumented.
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 WatchExpressionSidebarPane
setExpression
ExtensionPanel
watchExpressionSidebarPane.setExpression(, string
expression, string
rootTitle)
Undocumented.
Sets an expression that is evaluated within the inspected page. The result is displayed in the sidebar pane.
Parameters
-
expression
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- 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
enumerated
Type
array of
string
)
-
Undocumented.
- 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
-
paramName
-
Undocumented.
- A panel that was 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.
-
-
-
-
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(Type param1, Type param2) {...};
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
ExtensionPanel
watchExpressionSidebarPane.setHeight(, string
height)
Undocumented.
Sets the height of the sidebar.
Parameters
-
height
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- 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
-
paramName
-
Undocumented.
- A panel that was 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.
-
-
-
-
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(Type param1, Type param2) {...};
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
ExtensionPanel
watchExpressionSidebarPane.setObject(, string
jsonObject, string
rootTitle)
Undocumented.
Sets a JSON-compliant object to be displayed in the sidebar pane.
Parameters
-
jsonObject
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- 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
enumerated
Type
array of
string
)
-
Undocumented.
- 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
-
paramName
-
Undocumented.
- A panel that was 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.
-
-
-
-
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(Type param1, Type param2) {...};
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.