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