mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-18 07:18:34 +02:00
Adds an example for devtools inspector sidebar
This commit is contained in:
11
devtools-inspector-sidebar/devtools/devtools.js
Executable file
11
devtools-inspector-sidebar/devtools/devtools.js
Executable file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
This script is run whenever the devtools are open.
|
||||
In here, we can create our sidebar, and when the selected node in the inspector
|
||||
change, we evaluate it and display its properties in the sidebar.
|
||||
*/
|
||||
|
||||
browser.devtools.panels.elements.createSidebarPane("DOM").then(sidebar => {
|
||||
browser.devtools.panels.elements.onSelectionChanged.addListener(() => {
|
||||
sidebar.setExpression(`$0`);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user