Skip to content

Commit 988bafe

Browse files
committed
incorp rvw
1 parent 7b85976 commit 988bafe

11 files changed

Lines changed: 63 additions & 50 deletions
2.43 KB
Loading
3.73 KB
Loading
-51.8 KB
Loading
25.2 KB
Loading
-137 KB
Loading
Binary file not shown.
-174 Bytes
Loading

microsoft-edge/extensions-chromium/getting-started/part1-simple-extension.md

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ ms.author: msedgedevrel
66
ms.topic: conceptual
77
ms.service: microsoft-edge
88
ms.subservice: extensions
9-
ms.date: 01/10/2025
9+
ms.date: 01/13/2025
1010
---
1111
# Sample: Display an image in a pop-up
1212

1313
This sample is a simple static extension, without JavaScript, that displays the `stars.jpeg` image in a small webpage in a pop-up in any Microsoft Edge tab:
1414

15-
![The simple extension running](./part1-simple-extension-images/extension-running.png)
15+
![The simple extension running](./part1-simple-extension-images/extension-running.png)<!-- 1st use of this png -->
1616

1717

1818
<!-- ====================================================================== -->
1919
## Clone the MicrosoftEdge-Extensions repo
2020

2121
<!-- for all extensions samples, this is the main copy to propagate copy/paste/modify. put comments on lines that vary per-sample -->
22-
You can use various tools to clone a GitHub repo. You can download a selected directory, or clone the entire repo. These instructions use GitHub Desktop to clone the repo and switch to a working branch.<!-- future: doc git bash as the main way -->
22+
You can use various tools to clone a GitHub repo. You can download a selected directory, or clone the entire repo. These instructions use GitHub Desktop to clone the repo and switch to a working branch.
2323

2424
To clone the `MicrosoftEdge-Extensions` repo to your local drive:
2525

@@ -29,24 +29,41 @@ To clone the `MicrosoftEdge-Extensions` repo to your local drive:
2929

3030
1. Click the **Code** button, and then select **Open with GitHub Desktop**.
3131

32-
A dialog opens, saying **This site is trying to open GitHubDesktop.exe.**<!-- todo: update steps like part 2? -->
32+
A dialog opens, saying **This site is trying to open GitHubDesktop.exe.**
3333

3434
1. Click the **Open** button.
3535

3636
GitHub Desktop opens, with the **MicrosoftEdge-Extensions** repo selected in the upper left dropdown list.
3737

38-
1. In GitHub Desktop, click the **Branch** menu, and then click **New branch**.
38+
Or, in GitHub Desktop, the **Clone a repository** dialog opens:
39+
40+
![The "Clone a repository" dialog in GitHub Desktop](./part2-content-scripts-images/clone-a-repo-dbox-ghd.png)
41+
42+
1. Specify the local drive path to place the cloned repo directory into; for example: `C:\Users\accountname\GitHub\`.
43+
44+
1. Click the **Clone** button.
45+
46+
47+
**Create working branch:**
48+
49+
1. In GitHub Desktop, make sure that in the upper left of GitHub desktop, **Current repository** is **MicrosoftEdge-Extensions**.
50+
51+
In the **Current branch** drop-down list, it says **main**.
52+
53+
1. In the **Current branch** drop-down list, click the **Branches** tab, and then click the **New branch** button.
3954

4055
The **Create a branch** dialog opens.
4156

4257
1. In the **Name** text box, enter a branch name, such as **ext-sample-1**, and then click the **Create branch** button.
4358

4459
In the upper middle and lower left of GitHub Desktop, the current branch is shown, such as **ext-sample-1**.
4560

46-
You are now free to modify the code in your working branch, without altering the code that's in the "main" branch of the repo.
61+
You are now free to modify the code in your working branch, without altering the code that's in the "main" branch of the repo. Later you might want to switch back to the "main" branch, or create a different branch based off the "main" branch.
4762

48-
<!-- See also: -->
49-
<!-- * [Step 2: Create a branch](https://docs.github.com/en/get-started/start-your-journey/hello-world#step-2-create-a-branch) in _Hello World_. -->
63+
<!--
64+
See also:
65+
* [Step 2: Create a branch](https://docs.github.com/en/get-started/start-your-journey/hello-world#step-2-create-a-branch) in _Hello World_ in GitHub Docs.
66+
-->
5067

5168

5269
<!-- ====================================================================== -->
@@ -80,6 +97,8 @@ Instead of installing the sample from the Store, you'll install the sample local
8097
<!-- ====================================================================== -->
8198
## Run the sample
8299

100+
1. Go to a webpage, such as [TODO app](https://microsoftedge.github.io/Demos/demo-to-do/)<!-- https://github.com/MicrosoftEdge/Demos/tree/main/demo-to-do -->, in a new window or tab. For this sample, this step is optional and is just to match the screenshots; this sample doesn't require a webpage to be open.
101+
83102
1. In the upper right of Microsoft Edge, click the **Extensions** (![Extensions icon](./part1-simple-extension-images/extensions-icon.png)) button. Or, select **Settings and more** (...) > **Extensions**.
84103

85104
The **Extensions** pop-up opens:
@@ -88,9 +107,9 @@ Instead of installing the sample from the Store, you'll install the sample local
88107

89108
1. Click the extension's icon or name (**NASA picture of the day pop-up**).
90109

91-
The extension opens, and the extension's icon is added next to the Address bar and Extensions (![Extensions icon](./part1-simple-extension-images/extensions-icon.png)) icon. The extension displays `popup.html`, containing `stars.jpeg`, in a pop-up:
110+
The extension opens, and the extension's icon is added next to the Address bar and **Extensions** (![Extensions icon](./part1-simple-extension-images/extensions-icon.png)) icon. The extension displays `popup.html`, containing `stars.jpeg`, in a pop-up:
92111

93-
![The simple extension running](./part1-simple-extension-images/extension-running.png)
112+
![The simple extension running](./part1-simple-extension-images/extension-running.png)<!-- 2nd use of this png -->
94113

95114
You can open this particular sample extension in any tab, including an empty tab or the **Manage Extensions** tab.
96115

@@ -162,19 +181,24 @@ Every extension package must have a `manifest.json` file at the root. The manif
162181
<!-- ====================================================================== -->
163182
## Icons for launching the extension
164183

165-
The `/icons/` directory is in the same directory as the manifest file, to store the icon image files. The icons are used as the background image for the button that you click to launch the extension:
184+
The `/icons/` directory contains the icon image files. The icons are used as the background image for the button that you click to launch the extension:
166185

167-
![Icon on the toolbar to open the extension](./part1-simple-extension-images/part1-badge1.png)
186+
![The extension's icon in the Extensions pop-up list](./part1-simple-extension-images/extensions-popup-with-launch-icon.png)
187+
<!-- ~~ -->
188+
189+
When the extension is running, one of the icons is displayed on the toolbar, next to the Address bar:
168190

169191
![Icon on the toolbar](./part1-simple-extension-images/icon-png-toolbar.png)
170192

193+
To close the extension, click the extension's icon on the toolbar, or click the **Extensions** (![Extensions icon](./part1-simple-extension-images/extensions-icon.png)) button.
194+
171195
Recommendations for icons:
172196
* Use `PNG` format, but you can also use `BMP`, `GIF`, `ICO` or `JPEG` formats.
173197
* If you provide a single icon file, use 128 x 128 px, which can be resized by the browser if necessary.
174198

175199

176200
<!-- ====================================================================== -->
177-
## The default pop-up dialog (`popup.html`)
201+
## The pop-up dialog (`popup.html`)
178202

179203
`popup.html` in the `popup` directory runs when you launch the extension. When you click the icon to launch the extension, this file is displayed as a modal dialog.
180204

@@ -194,7 +218,9 @@ Recommendations for icons:
194218
</html>
195219
```
196220

197-
The popup (`popup.html`) is registered as the default popup in `manifest.json` under `action`:
221+
The popup (`popup.html`) is registered as the `"default_popup"` in `manifest.json`, in the `action` key section:
222+
223+
`manifest.json` (portion)
198224

199225
```json
200226
{
@@ -205,19 +231,11 @@ The popup (`popup.html`) is registered as the default popup in `manifest.json` u
205231
}
206232
```
207233

208-
<!-- ------------------------------ -->
209-
#### The Part 1 sample running
210-
211-
The simple extension running:
212-
213-
![The simple extension running](./part1-simple-extension-images/extension-running.png)
214-
215234

216235
<!-- ====================================================================== -->
217236
## Next steps
218237

219238
To develop your own Microsoft Edge extension, you can copy and modify the sample's directory, and install and test the resulting extension.
220-
<!-- todo: mention which branch you're in -->
221239

222240
After running and testing this extension sample, you can continue on to [Sample: Insert an image in the webpage](./part2-content-scripts.md), which dynamically inserts JavaScript running as content in the browser tab.
223241

-2 Bytes
Loading

0 commit comments

Comments
 (0)