You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: microsoft-edge/devtools-guide-chromium/quick-source/quick-source-tool.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -123,11 +123,11 @@ For example, if not done already, clone the **MicrosoftEdge / Demos** repo to yo
123
123
```
124
124
125
125
For details about cloning a repo, see:
126
-
*[Clone the Demos repo](../sample-code/sample-code.md#clone-the-demos-repo) in _Sample code for DevTools_.<!-- todo: show git bash, not only VS Code's Source Control pane -->
126
+
*[Clone the Edge Demos repo to your drive](../sample-code/sample-code.md#clone-the-edge-demos-repo-to-your-drive) in _Sample code for DevTools_.<!-- todo: show git bash, not only VS Code's Source Control pane -->
127
127
*[Clone the WebView2Samples repo](../../webview2/how-to/machine-setup.md#clone-the-webview2samples-repo) in _Set up your Dev environment for WebView2_. Shows a different sample repo, but shows steps for several tools.
128
128
*[Cloning a repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) - GitHub docs.
129
129
130
-
Now you have a local folder of source files (such as `/demo-to-do/`) that match the files on the web server.
130
+
Now you have a local folder of source files (such as `/demo-to-do/`) that match the files on the web server.
131
131
132
132
Continue with the next section.
133
133
@@ -183,7 +183,7 @@ Continue with the next section.
183
183
Now, when you edit the folder's files in DevTools, the edits are not only made to the transient file that's returned by the server, but are also saved to the source files on your local drive. You can edit the file from within the **Quick source** tool at the same time as displaying another tool (or from within the **Sources** tool).
184
184
185
185
See also:
186
-
*[Select a local Workspace, to use DevTools to edit files and save changes to disk](../sources/index.md#select-a-local-workspace-to-use-devtools-to-edit-files-and-save-changes-to-disk) in _Sources tool overview_.
186
+
*[Add a local folder to the workspace, to use DevTools to edit files and save changes to disk](../sources/index.md#add-a-local-folder-to-the-workspace-to-use-devtools-to-edit-files-and-save-changes-to-disk) in _Sources tool overview_.
187
187
*[Edit and save files in a workspace](../workspaces/index.md)
188
188
*[Step 4: Save a JavaScript change to disk](../workspaces/index.md#step-4-save-a-javascript-change-to-disk) in _Edit and save files in a workspace_
## Clone the Edge Demos repo to your drive by using git commands
179
+
## Clone the Edge Demos repo to your drive
180
180
181
181
The **Microsoft Edge / Demos** repo is useful for following the various DevTools documentation. You can clone the repo, start a localhost web server within a folder of the cloned repo, and then edit the demo files directly within DevTools, or within an editor such as VS Code.
182
182
@@ -208,8 +208,8 @@ For details about cloning a repo, see:
## Open a demo folder in the Sources tool and edit a file
268
-
269
-
To use this section, first [Clone the Edge Demos repo to your drive by using git commands](#clone-the-edge-demos-repo-to-your-drive-by-using-git-commands), or clone the repo another way, or download the repo.
267
+
## Open a demo folder from the Workspace tab in the Sources tool
268
+
<!-- todo: flatten article's TOC, then demote a few headings -->
270
269
271
-
To edit local files in the **Sources** tool, you might need to first click the **Allow** button to grant read/write access. To do that, follow the steps in [Opening a folder from the Workspace tab in the Sources tool](#opening-a-folder-from-the-workspace-tab-in-the-sources-tool) below.
270
+
To use this section, first do [Clone the Edge Demos repo to your drive](#clone-the-edge-demos-repo-to-your-drive), above.
272
271
273
272
See also:
274
273
*[Approaches compared](../../visual-studio-code/microsoft-edge-devtools-extension.md#approaches-compared) in _Microsoft Edge DevTools extension for Visual Studio Code_. Summarizes and compares several options for editing webpage files.
## Starting the localhost server from the Demos directory
298
+
## Start the localhost server
304
299
305
-
If you start the localhost server from within the entire `\Demos\` folder and then go to `localhost:8080`, you can navigate to each demo from within the browser. You can add the entire cloned `/Demos/` folder to the **Workspace** tab of the **Sources** tool. You then have full functionality for using DevTools as an IDE.
300
+
If you start the localhost server from a specific demo folder, such as `\Demos\demo-to-do`, and then go to `localhost:8080` (or simply open the local file such as `C:\Users\localAccount\GitHub\Demos\demo-to-do\index.html` in Microsoft Edge), the specific demo immediately is displayed in the browser. You can then add just the specific demo directory, such as `C:\Users\localAccount\GitHub\Demos\demo-to-do\`, to the **Workspace** tab of the **Sources** tool. You then have full functionality for using DevTools as an IDE, for that specific demo.
306
301
307
-
Starting the server from within the entire `\Demos\` directory:
302
+
Starting the server from within a specific demo directory:
308
303
309
304
```
310
-
$ cd "C:\Users\localAccount\GitHub\Demos"
305
+
$ cd "C:\Users\localAccount\GitHub\Demos\demo-to-do"
311
306
$ npx http-server
312
307
```
313
308
314
-
Example directory to add to the **Workspace** tab of the **Sources** tool: `C:\Users\localAccount\GitHub\Demos`
309
+
Example directory to add to the **Workspace** tab of the **Sources** tool: `C:\Users\localAccount\GitHub\Demos\demo-to-do`
315
310
316
311
Result of going to `localhost:8080`:
317
312
318
-

313
+

## Starting the localhost server from a specific Demos subdirectory
316
+
<!---------------------------------->
317
+
####Starting the localhost server from the Demos directory
323
318
324
-
If you start the localhost server from a specific demo folder, such as `\Demos\demo-to-do`, and then go to `localhost:8080` (or simply open the local file such as `C:\Users\localAccount\GitHub\Demos\demo-to-do\index.html` in Microsoft Edge), the specific demo immediately is displayed in the browser. You can then add just the specific demo directory, such as `C:\Users\localAccount\GitHub\Demos\demo-to-do\`, to the **Workspace** tab of the **Sources** tool. You then have full functionality for using DevTools as an IDE, for that specific demo.
319
+
If you start the localhost server from within the entire `\Demos\` folder and then go to `localhost:8080`, you can navigate to each demo from within the browser. You can add the entire cloned `/Demos/` folder to the **Workspace** tab of the **Sources** tool. You then have full functionality for using DevTools as an IDE.
325
320
326
-
Starting the server from within a specific demo directory:
321
+
Starting the server from within the entire `\Demos\` directory:
327
322
328
323
```
329
-
$ cd "C:\Users\localAccount\GitHub\Demos\demo-to-do"
324
+
$ cd "C:\Users\localAccount\GitHub\Demos"
330
325
$ npx http-server
331
326
```
332
327
333
-
Example directory to add to the **Workspace** tab of the **Sources** tool: `C:\Users\localAccount\GitHub\Demos\demo-to-do`
328
+
Example directory to add to the **Workspace** tab of the **Sources** tool: `C:\Users\localAccount\GitHub\Demos`
334
329
335
330
Result of going to `localhost:8080`:
336
331
337
-

332
+

## Opening a local HTML file from browser's File Open dialog and editing it in DevTools
336
+
## Opening a local HTML file from File Explorer and editing it in DevTools
342
337
343
338
To edit files in the **Sources** tool, before doing the steps in this section, you might need to click the **Allow** button to grant read/write access by following the steps in [Opening a folder from the Workspace tab in the Sources tool](#opening-a-folder-from-the-workspace-tab-in-the-sources-tool) above.
344
339
340
+
1. In File Explorer on Windows, or Finder on macOS, select an HTML file from the local copy of the **Demos** repo, such as `C:\Users\localAccount\Documents\GitHub\Demos\demo-to-do\index.html`.
341
+
342
+
The `.html` file is opened and rendered in Microsoft Edge.
343
+
344
+
The Address bar displays: **File | C:/Users/localAccount/GitHub/Demos/demo-to-do/index.html**
345
+
346
+
Selecting the URL in the address bar shows the URL format: `file:///C:/Users/localAccount/GitHub/Demos/demo-to-do/index.html`
347
+
348
+
1. Right-click the rendered webpage, and then select **Inspect**.
349
+
350
+
DevTools opens.
351
+
352
+
1. Select the **Sources** tool, and then select the **Page** tab or the **Workspace** tab.
353
+
354
+
See also:
355
+
*[Edit and save files in a workspace](../workspaces/index.md) - to open a local folder in the **Sources** tool of DevTools in the browser.
356
+
357
+
358
+
<!-- ------------------------------ -->
359
+
#### Opening a local HTML file from the browser's File Open dialog and editing it in DevTools
345
360
346
361
To open an `.html` file and edit it:
347
362
@@ -378,27 +393,6 @@ To open an `.html` file and edit it:
378
393

## Opening a local HTML file from File Explorer and editing it in the browser
383
-
384
-
1. In File Explorer on Windows, or Finder on macOS, select an HTML file from the local copy of the **Demos** repo, such as `C:\Users\localAccount\Documents\GitHub\Demos\demo-to-do\index.html`.
385
-
386
-
The `.html` file is opened and rendered in Microsoft Edge.
387
-
388
-
The Address bar displays: **File | C:/Users/localAccount/GitHub/Demos/demo-to-do/index.html**
389
-
390
-
Selecting the URL in the address bar shows the URL format: `file:///C:/Users/localAccount/GitHub/Demos/demo-to-do/index.html`
391
-
392
-
1. Right-click the rendered webpage, and then select **Inspect**.
393
-
394
-
DevTools opens.
395
-
396
-
1. Select the **Sources** tool, and then select the **Page** tab or the **Workspace** tab.
397
-
398
-
See also:
399
-
*[Edit and save files in a workspace](../workspaces/index.md) - to open a local folder in the **Sources** tool of DevTools in the browser.
0 commit comments