public static CdpSession EvalMsg(string script) { return(CdpSession.Create(Methods.RuntimeEval, new JObject { ["expression"] = script, ["awaitPromise"] = true, ["returnByValue"] = true })); }
public static CdpSession EvalMsg(JObject expression) { return(CdpSession.Create(Methods.RuntimeEval, new JObject { ["expression"] = JObject.FromObject(expression), ["awaitPromise"] = true, ["returnByValue"] = true })); }
internal static CdpSession EvalMsg(dynamic expression) { return(CdpSession.Create(Methods.RuntimeEval, new { expression, awaitPromise = true, returnByValue = true })); }
internal static CdpSession SetWindowBounds(int windowId, int width, int height, int left = 100, int top = 100, string windowState = "normal") { return(CdpSession.Create(Methods.BrowserSetWinBounds, new { windowId, bounds = new { left, top, width, height, windowState } })); }
internal static CdpSession AddScript(string source) { return(CdpSession.Create(Methods.PageAddScript, new { source })); }
internal static CdpSession AddBinding(string name) { return(CdpSession.Create(Methods.RuntimeAddBind, new { name })); }
internal static CdpSession Navigate(string url) { return(CdpSession.Create(Methods.PageNavigate, new { url })); }
private void Publish(string method, string paramsObj, Action <CdpSession, CdpResponse> callback = null) { Publish(CdpSession.Create(method, paramsObj), CancellationToken.None, callback).Wait(); }