public Task OnPromptAsync(Func <string, Task <PromptResponse> > function) { Func <object, Task <object> > promptFunction = async input => { PromptResponse response = await function((string)input); return(Task.FromResult(response == null ? null : response.Response)); }; return(ExecuteJavascriptFunction(browser.onPrompt, new { promptFunction })); }
public Task OnPromptAsync(string message, PromptResponse response) { return(ExecuteJavascriptFunction(browser.onPrompt, new { message, response = response.Response })); }