The Javascript methods that CefSharp
provides in relation to JavaScript Binding
are detailed below.
Duplicate methods are provided with different case to suit your preferred coding style. You can use CefSharp.BindObjectAsync
or cefSharp.bindObjectAsync
depending on your preference.
Bind the object that matches objectName, the IJavascriptObjectRepository.ResolveObject
will be raised with args.ObjectName
equal to objectName. If no objectName is provided then All
will be passed as args.ObjectName
Returns: a Promise
that can be awaited
.
IJavascriptObjectRepository.ObjectBoundInJavascript
event even if the object is already bound (by default the event will not be called if an object is already bound). IgnoreCache yes If true then the local cache will be ignored and the request to the IJavascriptObjectRepository
will be made
Example 1
(async function() { //`IJavascriptObjectRepository.ResolveObject` will be called with `args.ObjectName` of `All`. await CefSharp.BindObjectAsync(); //Objects will have been bound, you can now access them })();
Example 2
(async function() { await CefSharp.BindObjectAsync("boundAsync"); //Object with name boundAsync will have been bound, you can now access })();
Example 3
(async function() { await CefSharp.BindObjectAsync({ NotifyIfAlreadyBound: true, IgnoreCache: true }, "boundAsync2"); //Object with name boundAsync2 will have been bound, you can now access them. // Cache will have been ignored and notification in `.Net` will have been provided through `IJavascriptObjectRepository.ObjectBoundInJavascript` })();CefSharp.DeleteBoundObject(objectName)
Deletes the object that matches objectName
Param Optional Remarks objectName no Name of the object to be deletedReturns: bool, true if successful otherwise false
Example 1
CefSharp.DeleteBoundObject("boundAsync");CefSharp.RemoveObjectFromCache(objectName)
Removes the object that matches objectName from the cache
Param Optional Remarks objectName no Name of the object to be removed from the cacheReturns: bool, true if successful otherwise false
Example 1
CefSharp.RemoveObjectFromCache("boundAsync"); //You can use lowercase version if you like, exactly the same function cefSharp.removeObjectFromCache("boundAsync");CefSharp.IsObjectCached(objectName)
Does an object with name objectName
exist in the cache
Returns: bool, true if cached otherwise false
Example 1
CefSharp.IsObjectCached("boundAsync") === true; //You can use lowercase version if you like, exactly the same function cefSharp.IsObjectCached("boundAsync") === true;
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4