HostObjectsAsyncRoot class
Contains asynchronous proxies for all host objects added via CoreWebView2.AddHostObjectToScript
as well as options to configure those proxies, and the container for synchronous proxies.
If you call coreWebView2.AddHostObjectToScript("myObject", object);
in your native code, an asynchronous proxy for object
is available to your web-side code, by using chrome.webview.hostObjects.myObject
.
- Extends
Properties
options | Contains options applicable to |
sync | Contains synchronous proxies for all host objects added via If you call |
Methods
cancel |
Performs a best-effort cancellation on promises for async method calls. |
cleanup |
Performs a best effort garbage collection on host object proxies that are no longer in use. |
Property Details
options
Contains options applicable to CoreWebView2.AddHostObjectToScript
added script proxies.
options: HostObjectsOptions;
Property Value
sync
Contains synchronous proxies for all host objects added via CoreWebView2.AddHostObjectToScript
.
If you call coreWebView2.AddHostObjectToScript("myObject", object);
in your native code, a synchronous proxy for object
is available to your web-side code, by using chrome.webview.hostObjects.sync.myObject
.
sync: HostObjectsSyncRoot;
Property Value
Method Details
cancelPromise(promise)
Performs a best-effort cancellation on promises for async method calls.
cancelPromise(promise: Promise<HostObjectAsyncProxy>): void;
Parameters
- promise
-
Promise<HostObjectAsyncProxy>
Returns
void
cleanupSome()
Performs a best effort garbage collection on host object proxies that are no longer in use.
cleanupSome() : void;
Returns
void