This repository was archived by the owner on Oct 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
JavaScript Execution
softoille@gmail.com edited this page Nov 29, 2019
·
1 revision
Frame handling allows developers to have access to the application browser and frames (iframe) objects, and with that JavaScript methods defined in the renderer can be executed from the browser.
To do that easily, a static helper class is provided - CefSharp FrameHanlder or CefGlue FrameHandler.
There are 3 methods provided:
- GetMainFrame
- GetFrame - requires the name of the frame as parameter.
- GetBrowser
To get the frame name, the developer will have to declare that in the iframe object.
<iframe id="demoframe" name="alldemoframe" .. />
</div>
IFrame frame = FrameHandler.GetFrame(frameName);
frame.ExecuteJavaScriptAsync(script);
IFrame frame = FrameHandler.GetFrame(frameName);
Task<JavascriptResponse> javascriptResponse = frame.EvaluateScriptAsync(script);
javascriptResponse.Wait();
IFrame frame = FrameHandler.GetFrame(frameName);
frame.ExecuteJavaScript(script, null, 0);
For demo please see CefSharp JavaScript | CefSharp Controller and CefGlue JavaScript | CefGlue Controller.
Demo Page:
Chromely
Getting Started
The Basics
Digging Deeper
- Sub-Process
- Infrastructure
- Restful Resources
- Register Resource Assemblies
- Custom Local Resource Handling
- Custom Scheme Handling
- Expose .NET class to JavaScript
- Generic Message Routing
- Real-time with Websocket
- External Url Registration
Angular - React - Vue