Repository navigation
Webview Api Prototype - #42690
Webview Api Prototype#42690
Conversation
eb01c36 to
3a00daf
Compare
|
A suggestion: allow reading the current content of the view as text. This way it's possible to see the actual HTML text, including what vscode added/changed (and store it on disk, for further use). And I would love to see a way to access variables in the DOM. That doesn't require to make the entire DOM public, just a way to read and set variables. This would make updating a webview a lot simpler, without fully reloading it. It would also allow to save and restore state, in case such a view must be generated the same way as it was when the user left it. |
3a00daf to
de62574
Compare
|
Mike Lischke (@mike-lischke) This new API makes it easier to implement that functionality if you would find it useful. They are a bit too high level in my view for the vscode core api |
|
Thanks Matt Bierner (@mjbvz), I'll certainly give it a try. The simplified messaging looks good, I can probably come up with a function that allows to update variables via that. Does |
|
Matt Bierner (@mjbvz) Will you add a WebView example to https://github.com/Microsoft/vscode-extension-samples? |
|
Matt Bierner (@mjbvz) when the WebView can be used in the extension development? |
Moving #41853 to branch on main repo
Proposes a new Api for webviews. This API aims to make the current html preview api more usable, safer, and more extensible for the future.
Besides the new API, the new webviews also differ in several important ways:
file://origin so they can't read files on disk (you have to use the new protocols for this)postMessageinside of webviews now posts back to vscode directly (no more weird click faking required)TODO
onFocusandonBlurto the webview objectAdd editorColumn property on webviewenableCommandUrisoption actually enable command uris