Commit Graph

19 Commits

Author SHA1 Message Date
Matt Bierner
307cb32f30 Add vscode-webview-resource protocol (#97777)
* Add vscode-webview-resource protocol

Adds a new protocol (`vscode-webview-resource`) for loading resources insides of webviews. This replaces the existing `vscode-resource` protocol and is registered on the main thread instead of in each renderer

This change also adds some rewriting logic to update any `vscode-resource:` references found in the main html to use `vscode-webview-resource` instead.

* Move webview protcol provider to own file

* Remove registration of vscode-resource scheme

* Remove use or parition for each webview

Now that we have a single shared protocol handler, we do not need to run each webview in its own partition

* Fix rewriting csp to use new protocol

* Update src/vs/code/electron-main/app.ts

Co-authored-by: Benjamin Pasero <benjpas@microsoft.com>

Co-authored-by: Benjamin Pasero <benjpas@microsoft.com>
2020-05-15 11:34:08 -07:00
Matt Bierner
da59b13916 Use more explicit names for webview types 2020-03-04 14:14:31 -08:00
Matt Bierner
dc0ab50035 Use isEqual for comparing uris in more places vs .toString() 2019-10-04 15:22:42 -07:00
Matt Bierner
0506f7f736 Make sure image views (and custom editors) work properly on the web
This fixes an issue where webviews for custom editors did not have any associated extension information, which caused them try reading `file:` uri resources instead of remote uri resources
2019-09-25 16:25:39 -07:00
Matt Bierner
7a00ddf9f8 Format files for 3.6
Fixes #80118
2019-09-02 21:29:05 -06:00
Matt Bierner
df0dd2edc2 Move webview into browser
Fixes #79424

This file depends on dom api so it should live in browser instead of common
2019-08-19 21:06:47 -07:00
Matt Bierner
99912f5866 Remove webview svg whitelist
This is no longer required
2019-08-15 18:18:42 -07:00
Alex Dima
16051c7a41 - use strings for view zone ids
- make it unlikely that a new view instance would accept a view zone id from a previous view instance
- remove that the find widget removes a view zone id from another view
(fixes #71745)
2019-08-14 17:55:34 +02:00
Johannes Rieken
06701f533d add a bunch of strict field initializations 2019-07-31 12:30:30 +02:00
Matt Bierner
928ae46457 Rewrite how webviews are managed internally
This change attempts to do the following:

- Encapsult most of the logic for handling the webviews used for webview editors into a new WebviewEditorOverlay class
- Greatly simplify WebviewEditorInput and make it take a webview when it is created
- Move the webview creation logic up into the webviewEditorService instead of having it be inside the webviewEditor class itself

This aim of these changes is to make it possible to re-use more of the webview logic for custom editors
2019-07-17 18:14:08 -07:00
Matt Bierner
5106b556bd Support loading webviews from wildcard endpoints
Fixes #77132

Add support for loading webviews from and endpoint that looks like:

```
https://{{uuid}}.contoso.com/path/to/some/commit/index.html
```

This lets us serve each webview from a seperate origin
2019-07-12 15:38:12 -07:00
Matt Bierner
a558a9504a Adding toWebviewResource api
For #76489
2019-07-08 18:38:47 -07:00
Matt Bierner
0722dc5c0e Error if we try to perform an operation on an unknown editor inset 2019-07-03 11:28:07 -07:00
Matt Bierner
8119b4aee7 Move the webviewResourceRoot property to be set on each webview instead of as a global property
For #72155

This allows  us to potentially change the resource root per webview
2019-06-24 17:07:06 -07:00
Johannes Rieken
5c3bab92ac more code insets API tweaks, #66418 2019-06-20 10:30:25 +02:00
Rob DeLine
b0a49817dc z-order bug fix 2019-06-18 16:22:21 -07:00
Rob DeLine
b799118b39 fix 2019-06-12 12:49:58 -07:00
Johannes Rieken
1ad12b24a6 allow extension resources in editor insets 2019-06-12 18:09:34 +02:00
Johannes Rieken
6f1da34c2e debt - decouple webviews from code insets, move things to /browser/-layer, change inset api proposal to push style, re #66418 2019-06-04 12:31:18 +02:00