| title | Sample: Custom DevTools tool |
|---|---|
| description | Microsoft Edge extension that adds a Custom tool in DevTools. Sends messages between the inspected webpage and DevTools. |
| author | MSEdgeTeam |
| ms.author | msedgedevrel |
| ms.topic | article |
| ms.service | microsoft-edge |
| ms.subservice | extensions |
| ms.date | 04/06/2026 |
The sample "Custom DevTools tool" is a Microsoft Edge extension that adds a Custom tool in Microsoft Edge DevTools, including a tab in the Activity Bar, and a panel below the tab. The tool name and its tab in DevTools can be something other than Custom.
-
The Custom DevTools tool calls the DevTools API to display memory information.
-
The webpage under inspection, and the Custom DevTools tool, send messages to each other.
Download, install, use, and modify the sample, as follows.
See also:
- Overview of DevTools
- Create a DevTools extension, adding a custom tool tab and panel
- Code for Custom DevTools tool
- /devtools-extension/ - Readme and source code for the Custom DevTools Tool sample.
The Custom DevTools Tool adds a Custom tool tab and panel in DevTools within Microsoft Edge:
The Custom tool in DevTools calls the DevTools API (chrome.system.memory.getInfo((data)) to retrieve and display memory information.
The Custom tool in DevTools has a button that sends a message to the inspected webpage. The inspected webpage then displays a JavaScript alert dialog:
Clicking around within the inspected webpage sends a message to DevTools. The Custom tool uses a content script to send a message (the clicked coordinates) from the inspected webpage (any webpage) to the Custom DevTools tool and the Console tool in DevTools.
The Custom tool displays the mouse-click coordinates from the message:
The Console tool also displays the mouse-click coordinates from the message:
If not done yet, download the "main" branch of the Demos repo, or clone (or fork and clone) the repo. Downloading the repo is simplest, and is described below.
Download the "main" branch of the Demos repo, as follows:
-
In Microsoft Edge, go to the MicrosoftEdge / Demos repo.
-
Click the down arrow in the Code button, and then select Download ZIP.
-
In Microsoft Edge, the Downloads dialog shows
Demos-main.zip. "-main" is added, meaning a static snapshot of the "main" branch of the repo. -
Hover to the right of
Demos-main.zip, and then click the Show in folder
button.File Explorer opens, displaying the Downloads folder.
-
Right-click
Demos-main.zip, and then select Extract all.The Extract Compressed (Zipped) Folders dialog opens.
-
Click the Extract button.
The % complete dialog opens, and then finishes.
-
Move the
Demos-mainfolder to a GitHub repos location, such asC:\Users\localAccount\GitHub.
-
In Microsoft Edge, select Settings and more (
), hover over Extensions, and then select Manage extensions.The Extensions tab and page opens (
edge://extensions). -
The Select the extension directory dialog opens.
-
Navigate to the
/Demos-main/devtools-extensionfolder, such asC:\Users\localAccount\GitHub\Demos-main\devtools-extension\, and then click the Select Folder button.The Custom DevTools Tool card is displayed:
-
In Microsoft Edge, go to a webpage, such as the To Do app, in a new window or tab.
The Custom DevTools tool requires a webpage, not an empty tab.
-
Right-click the webpage, and then select Inspect.
DevTools opens.
-
In the Activity Bar of DevTools, click the Custom (
) tool's tab.The Custom tool tab and panel are displayed:
If the Custom (
) tool's tab isn't visible, do any of the following:The custom DevTools page has several sections:
-
Memory display information.
-
A button to send a message from DevTools to the inspected webpage, to make the page display a JavaScript
alertdialog. -
A Coordinates display area, to send a message from the inspected webpage to the DevTools Console and Custom tools.
-
-
In the Custom tool, next to Available Memory Capacity, observe the once-per-second updating of the value:
-
In the Custom tool, click the Say Hello button.
A JavaScript
alertdialog opens, displaying the message: "Hello from the DevTools extension!"DevTools sends a message to the inspected webpage, causing JavaScript to display an alert.
-
Click the OK button.
The dialog closes.
-
In the inspected webpage, click various spots.
In the Custom tool, next to Coordinates, the coordinates are displayed and updated while you click around:
-
In DevTools, in the Activity Bar, select the Console (
) tool. -
In the inspected webpage, click various spots.
The clicked coordinates are displayed in the Console:
-
If not done already, install Visual Studio Code.
-
Open Visual Studio Code.
-
Click the File menu, and then click Open Folder.
The Open Folder dialog opens.
-
Navigate to the
/Demos-main/devtools-extension/folder, such asC:\Users\localAccount\GitHub\Demos-main\devtools-extension\, and then click the Select Folder button.A dialog opens, asking whether to open the repo in the parent folder.
-
Click the Yes button.
In the Explorer pane, the
/devtools-extension/folder is displayed. -
Click
panel.html.panel.htmlis opened for editing: -
Add "My" to the
<h2>heading; change from:<h2>Custom DevTools Tool</h2>
to:
<h2>My Custom DevTools Tool</h2>
-
Save
panel.html. -
In the Explorer pane, click
manifest.json.manifest.jsonis opened for editing. -
Add "My" to the
name; change from:"name": "Custom DevTools Tool",
to:
"name": "My Custom DevTools Tool",
-
Save
manifest.json.
-
In Microsoft Edge, select Settings and more (
), hover over Extensions, and then select Manage extensions.The Extensions tab and page opens (
edge://extensions). -
In the Custom DevTools Tool card, click the Reload link.
The card now shows My Custom DevTools Tool as the name of the extension:
An Errors link might appear in the card, displaying "Uncaught Error: Extension context invalidated", because the sample was modified while still in use. If you want to avoid this error, you can click Remove in the Custom DevTools Tool card, and then click Load unpacked.
-
Go to a webpage, such as the To Do app, in a new window or tab.
The Custom DevTools tool requires a webpage, not an empty tab.
-
Right-click the webpage, and then select Inspect.
DevTools opens.
-
In the Activity Bar of DevTools, click the Custom (
) tool's tab.The Custom tool is displayed, with the word My added to the heading in the panel:
If the title still says Custom DevTools Tool instead of My Custom DevTools Tool, close and reopen DevTools.
If the Custom (
) tool's tab isn't visible, do any of the following:
This is the end of the steps to use and modify the DevTools Extension sample. Next, you can study Code for Custom DevTools tool.
If the Custom tab isn't visible in DevTools, or it's outdated and doesn't show your latest code changes:
-
Make DevTools wide, to show many tools in the Activity Bar.
-
Close and reopen DevTools.
-
Refresh or hard-refresh the inspected page.
-
In Microsoft Edge, in the Extensions page, click Reload for the extension.
-
If no icon is provided in such an extension, the tab when not selected is narrow and gray, on the right side of the Activity Bar. Click the narrow gray tab.
-
Go to a webpage, not an empty tab. The code in the sample "Custom DevTools tool" requires a webpage.
When the Activity Bar is narrow, the Custom Devtools tool is added to the More tools menu on the Activity Bar.
The Custom tab doesn't have a Remove from Activity Bar command on the right-click menu.









