mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-16 14:28:33 +02:00
12 lines
398 B
JavaScript
Executable File
12 lines
398 B
JavaScript
Executable File
/**
|
|
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`);
|
|
});
|
|
});
|