Skip to content

Commit

Permalink
Add note on reloading webviews
Browse files Browse the repository at this point in the history
  • Loading branch information
mjbvz committed Apr 26, 2018
1 parent 545d9d4 commit cd248f2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/extensions/webview.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,12 +335,14 @@ The **Developer: Open Webview Developer Tools** VS Code command lets you debug w

The contents of the webview are within an iframe inside the webview document. You can use developer tools to inspect and modify the webview's DOM, and debug scripts running within the webview itself.

If you use use the webview developer tools console, make sure to select the 'active frame' environment from the dropdown in the top left corner of the console panel.
If you use use the webview developer tools console, make sure to select the 'active frame' environment from the dropdown in the top left corner of the console panel:

![Selecting the active frame](images/webview/debug-active-frame.png)

The 'active frame' environment is where the webview scripts themselves are executed.

In addition, the **Deveoper: Reload Webview** command reloads all active webviews. This can be helpful if you need to reset a webview's state, or if some webview content on disk has changed and you want the new content to be loaded.

## Loading local content

Webviews run in isolated contexts that cannot directly access local resources. This is done for security reasons. This means that in order to load images, stylesheets, and other resources from your extension, or to load any content from the user's current workspace, you must use the `vscode-resource:` scheme inside webview.
Expand Down

0 comments on commit cd248f2

Please sign in to comment.