提交 b9eeccc7 编写于 作者: M Matt Bierner

Document that webviews do not let you post blobs or other dom objects

Fixes #79257
上级 5ed4cdab
...@@ -5912,6 +5912,10 @@ declare module 'vscode' { ...@@ -5912,6 +5912,10 @@ declare module 'vscode' {
/** /**
* Fired when the webview content posts a message. * Fired when the webview content posts a message.
*
* Webview content can post strings or json serilizable objects back to a VS Code extension. They cannot
* post `Blob`, `File`, `ImageData` and other DOM specific objects since the extension that receives the
* message does not run in a browser environment.
*/ */
readonly onDidReceiveMessage: Event<any>; readonly onDidReceiveMessage: Event<any>;
...@@ -5921,7 +5925,7 @@ declare module 'vscode' { ...@@ -5921,7 +5925,7 @@ declare module 'vscode' {
* Messages are only delivered if the webview is live (either visible or in the * Messages are only delivered if the webview is live (either visible or in the
* background with `retainContextWhenHidden`). * background with `retainContextWhenHidden`).
* *
* @param message Body of the message. * @param message Body of the message. This must be a string or other json serilizable object.
*/ */
postMessage(message: any): Thenable<boolean>; postMessage(message: any): Thenable<boolean>;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册