Example #1
0
 public static CdpSession EvalMsg(string script)
 {
     return(CdpSession.Create(Methods.RuntimeEval, new JObject
     {
         ["expression"] = script,
         ["awaitPromise"] = true,
         ["returnByValue"] = true
     }));
 }
Example #2
0
 public static CdpSession EvalMsg(JObject expression)
 {
     return(CdpSession.Create(Methods.RuntimeEval, new JObject
     {
         ["expression"] = JObject.FromObject(expression),
         ["awaitPromise"] = true,
         ["returnByValue"] = true
     }));
 }
Example #3
0
 internal static CdpSession EvalMsg(dynamic expression)
 {
     return(CdpSession.Create(Methods.RuntimeEval,
                              new { expression, awaitPromise = true, returnByValue = true }));
 }
Example #4
0
 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 } }));
 }
Example #5
0
 internal static CdpSession AddScript(string source)
 {
     return(CdpSession.Create(Methods.PageAddScript, new { source }));
 }
Example #6
0
 internal static CdpSession AddBinding(string name)
 {
     return(CdpSession.Create(Methods.RuntimeAddBind, new { name }));
 }
Example #7
0
 internal static CdpSession Navigate(string url)
 {
     return(CdpSession.Create(Methods.PageNavigate, new { url }));
 }
Example #8
0
 private void Publish(string method, string paramsObj, Action <CdpSession, CdpResponse> callback = null)
 {
     Publish(CdpSession.Create(method, paramsObj), CancellationToken.None, callback).Wait();
 }