-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevtools.js
More file actions
28 lines (25 loc) · 1.06 KB
/
Copy pathdevtools.js
File metadata and controls
28 lines (25 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"use strict";
console.log("[CSSTree] devtools.js loaded", { href: location.href });
// Create the main panel tab that will appear alongside Elements, Console, Sources, etc.
console.log("[CSSTree] creating CSS Tree Inspector panel");
chrome.devtools.panels.create(
"CSS Tree Inspector",
"icons/icon16.png",
"panel/panel.html",
function(panel) {
const visibilityChannel = new BroadcastChannel("css-tree-inspector-panel-visibility");
panel.onShown.addListener(() => visibilityChannel.postMessage({ visible: true }));
panel.onHidden.addListener(() => visibilityChannel.postMessage({ visible: false }));
}
);
console.log("[CSSTree] CSS Tree Inspector panel registration complete");
// Create the sidebar pane in the Elements panel
console.log("[CSSTree] creating Elements sidebar pane");
chrome.devtools.panels.elements.createSidebarPane(
"CSS Tree Inspector",
function(sidebar) {
console.log("[CSSTree] Elements sidebar created", sidebar);
sidebar.setPage("sidebar/sidebar.html");
}
);
console.log("[CSSTree] Elements sidebar registration complete");