Skip to content

Commit 9cd2f5e

Browse files
committed
demote VS Code
1 parent a10a53a commit 9cd2f5e

1 file changed

Lines changed: 27 additions & 23 deletions

File tree

microsoft-edge/extensions-chromium/developer-guide/devtools-extension.md

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,14 @@ ms.date: 11/12/2024
1010
---
1111
# Create a DevTools extension, adding a custom tool tab and panel
1212

13-
Part 1: Sample - This article shows how to install and run the provided sample of a DevTools extension, which adds a **Sample Panel** tool tab in DevTools within Microsoft Edge. The sample is a working DevTools extension that creates its own panel, and interacts with the DevTools APIs.
13+
This article provides a sample and code walkthrough for a Microsoft Edge extension that adds a tool tab and panel in DevTools.
1414

15-
Part 2: Tutorial - This article then shows how you can optionally create that sample from scratch, and explains each step of developing the sample, and how the added code works. This tutorial shows how to build your own DevTools extension from scratch. It's a good way to experience everything that's needed for typical development.
15+
This article first shows how to install and run the provided DevTools extension sample, which adds a **Sample Panel** tool tab in DevTools within Microsoft Edge. The sample is a working DevTools extension that creates its own panel, and interacts with the DevTools APIs.
16+
17+
This article then presents a tutorial that shows how you can optionally create that sample from scratch, and explains each step of developing the sample, and how the added code works. These tutorial steps are a good way to experience everything that's needed for typical development.
18+
19+
See also:
20+
* [Overview of DevTools](../../devtools-guide-chromium/overview.md)
1621

1722

1823
<!-- ====================================================================== -->
@@ -54,24 +59,22 @@ To download, install, run, and test the provided, finished DevTools extension sa
5459

5560
A message is displayed in the extension panel: **You clicked on position (199, 509) in the inspected page**:
5661

57-
![The sample panel in DevTools showing the clicked position message](./devtools-extension-images/devtools-extension-show-position.png)
62+
![The sample panel in DevTools showing the clicked position message](./devtools-extension-images/devtools-extension-show-position.png)
5863

59-
1. Open the **Console** tool. A message appears in the **Console** tool: **Received response > _{xPosition: 199, yPosition: 509}_**:
64+
1. Select the **Console** tool.
6065

61-
![The DevTools Console tool showing the clicked position message](./devtools-extension-images/devtools-extension-show-position-in-console.png)
62-
63-
You downloaded, installed, ran, and tested the provided, finished DevTools extension sample. In the next steps, you create the same sample by starting from an empty directory. The following sections explain how the code works.
66+
A message appears in the **Console** tool: **Received response > _{xPosition: 199, yPosition: 509}_**:
6467

68+
![The DevTools Console tool showing the clicked position message](./devtools-extension-images/devtools-extension-show-position-in-console.png)
6569

66-
<!-- ====================================================================== -->
67-
## Install Visual Studio Code
68-
69-
* If not done already, install a code editor such as [Visual Studio Code](https://code.visualstudio.com/), to follow the tutorial steps below to manually re-create the above sample DevTools extension.
70+
You downloaded, installed, ran, and tested the provided, finished DevTools extension sample. In the next steps, you create the same sample by starting from an empty directory. The following sections explain how the code works.
7071

7172

7273
<!-- ====================================================================== -->
7374
## Step 1: Create, install, and run a basic Microsoft Edge extension
7475

76+
If you want to create the files for each major step below, install a code editor such as [Visual Studio Code](https://code.visualstudio.com/), to follow the tutorial steps below to manually re-create the above sample DevTools extension. You can read the code walkthrough below, presented as four major steps or phases.
77+
7578
A basic extension for Microsoft Edge consists of two files, as shown in [Step 1 code](https://github.com/MicrosoftEdge/Demos/tree/main/devtools-extension/sample%201):
7679

7780
* A manifest file, containing key/value pairs. The top-level keys are called _members_. In this case, the file is named `manifest.json`:
@@ -236,7 +239,7 @@ To test your changes in Microsoft Edge, reload your extension from the `edge://e
236239

237240

238241
<!-- ====================================================================== -->
239-
## Step 3: Call extension APIs from a DevTools extension
242+
## Step 3: Display memory information by calling extension APIs
240243

241244
In this step, you will use extension APIs to display memory information in your DevTools panel. To do this, we will need to update the `permissions` in the manifest file, the panel interface, and the devtools script. The source code for this step can be found in [Step 3 code](https://github.com/MicrosoftEdge/Demos/tree/main/devtools-extension/sample%203), or write it yourself by following the instructions below.
242245

@@ -324,13 +327,13 @@ See also:
324327

325328

326329
<!-- ====================================================================== -->
327-
## Step 4: Interact with the inspected webpage
330+
## Step 4: Interact between the webpage and DevTools
328331

329332
In this step of the tutorial, you will add code that interacts with the inspected webpage. That code will:
330333

331334
1. Listen to click events that happen on the webpage and log them into the DevTools **Console** tool.
332-
1. Show the mouse click position in the DevTools extension panel.
333-
1. Show a greeting alert in the inspected page when user clicks a button in the DevTools extension panel.
335+
1. Display the mouse click position in the DevTools extension panel.
336+
1. When the user clicks a button in the DevTools extension panel, display a greeting alert in the inspected webpage.
334337

335338
You can copy the files that are the end result of this step from [Step 4 code](https://github.com/MicrosoftEdge/Demos/tree/main/devtools-extension/sample%204), or create the files yourself by following the instructions below.
336339

@@ -498,21 +501,22 @@ To test the new `sayHello` button:
498501

499502
1. Click the **OK** button to close the alert.
500503

501-
See also:
502-
* [Content scripts](https://developer.chrome.com/docs/extensions/mv3/content_scripts/) in the Chrome Extensions docs.
504+
1. Click anywhere in the inspected page.
503505

506+
A message is displayed in the extension panel: **You clicked on position (199, 509) in the inspected page**:
504507

505-
To test the `youClickedOn` label:
508+
![The sample panel in DevTools showing the clicked position message](./devtools-extension-images/devtools-extension-show-position.png)
506509

507-
1. Click anywhere in the inspected page.
510+
1. Select the **Console** tool.
508511

509-
A message is displayed in the extension panel: **You clicked on position (199, 509) in the inspected page**:
512+
A message appears in the **Console** tool: **Received response > _{xPosition: 199, yPosition: 509}_**:
510513

511-
![The sample panel in DevTools showing the clicked position message](./devtools-extension-images/devtools-extension-show-position.png)
514+
![The DevTools Console tool showing the clicked position message](./devtools-extension-images/devtools-extension-show-position-in-console.png)
512515

513-
1. Open the **Console** tool. A message appears in the **Console** tool: **Received response > _{xPosition: 199, yPosition: 509}_**:
516+
This completes the tutorial and code walkthrough for creating a DevTools extension that adds a tool tab and panel in DevTools in Microsoft Edge.
514517

515-
![The DevTools Console tool showing the clicked position message](./devtools-extension-images/devtools-extension-show-position-in-console.png)
518+
See also:
519+
* [Content scripts](https://developer.chrome.com/docs/extensions/mv3/content_scripts/) in the Chrome Extensions docs.
516520

517521

518522
<!-- ====================================================================== -->

0 commit comments

Comments
 (0)