internal async Task <ChromiumSession> CreateSessionAsync(Protocol.Target.TargetInfo targetInfo)
        {
            string sessionId = (await RootSession.SendAsync(new TargetAttachToTargetRequest
            {
                TargetId = targetInfo.TargetId,
                Flatten = true,
            }).ConfigureAwait(false)).SessionId;

            return(await GetSessionAsync(sessionId).ConfigureAwait(false));
        }
Пример #2
0
 public static TargetType GetTargetType(this Protocol.Target.TargetInfo targetInfo)
 => targetInfo.Type switch
 {
     "page" => TargetType.Page,
Пример #3
0
 public static TargetType GetTargetType(this Protocol.Target.TargetInfo targetInfo) => targetInfo.Type.ToEnum <TargetType>();