Commit Graph

24 Commits

Author SHA1 Message Date
Matt Bierner
3499f63dc1 Exploration: Better transferring of TypedArrays used in Webview.postMessage (#115664)
* Improve passing of ArrayBuffers to and from webviews

Fixes #115807

* Serialize and restore typed arrays too

This also makes it so that if you pass the same ArrayBuffer twice in an object, we use a single object on the receiver side too

* Fix spelling

* Require VS Code 1.56+
2021-03-30 06:49:34 +00:00
Matt Bierner
ea5f05a435 Trying to clairify how webview options are used and passed around
- Move protocol types into protocol
- Hold off on combining the options objects until serialization
- Add explicit converstions instead of using `...`
- Make a few methods take property bags to help avoid passing arguments in wrong order
2021-03-05 18:49:17 -08:00
Johannes Rieken
1bd7cf9e41 use gh username for todo-tags, nuke some todo-tags 2020-11-02 14:16:55 +01:00
Matt Bierner
5f3e2078a3 Add more explict message queue for webviews while they are loading 2020-06-11 20:05:33 -07:00
Matt Bierner
50f907f0ba Add more strict typing for webview options
We can only send URI components over from the extension host to the renderer process. Make sure the typings reflect that

Follow up on #98746
2020-05-30 11:03:18 -07:00
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