Replies: 1 comment
-
That's one way. Another is to use https://github.com/cefsharp/CefSharp.Dom#dom-access //Event Handler
//Expose a function to javascript, functions persist across navigations
//So only need to do this once
await devToolsContext.ExposeFunctionAsync("jsAlertButtonClick", () =>
{
_ = devToolsContext.EvaluateExpressionAsync("window.alert('Hello! You invoked window.alert()');");
});
var jsAlertButton = await devToolsContext.QuerySelectorAsync<HtmlButtonElement>("#jsAlertButton");
//Write up the click event listner to call our exposed function
_ = jsAlertButton.AddEventListenerAsync("click", "jsAlertButtonClick"); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! For GeckoFX I could handle following events: DomBlur, DomFocus, DomMouseHandler, DomClick handlers. What is best approach to handle them for Cefsharp? Using JavascriptMessageReveived or another way?
Beta Was this translation helpful? Give feedback.
All reactions