SIGN IN SIGN UP
cefsharp / CefSharp UNCLAIMED

.NET (WPF and Windows Forms) bindings for the Chromium Embedded Framework

0 0 0 C#
Enhancement - Add DevToolsClient (#3229) * Core - Add DevToolsClient Issue #3165 * DevTools Client - Add Network domain class - Add hand written class to get a better sense of how the code should be structured. - Improve exception handling * Devtools - First draft of devtools protocol methods (generated) Not complete yet * Devtools - Simple method execution working * DevTools - Add .Net Style cased property names to response objects - Use internal field and datacontract attributes * DevTools - Improve mapping * DevTools - Strongly typed enums * DevTools Client - Generated from active browser instance (M84) * Devtools Client - Extract IDevToolsClient interface for testability Improve xml doc comments * DevTools Client - Improve error handling * DevTools Client - Improve enum conversion * Revert to older c# syntax * DevTools Client - Fix failing tests * Devtools Client - Add SetCookie Tests * DevTools Client - Add Capture SyncContext by default - Add option to capture the SyncContext - Add option to provide custom SyncContext (can just pass in UI SyncContext and all continuations will happen there). - Fix bug in ExecuteDevToolsMethodAsync sending the command twice when exeucted on the CEF UI thread * Devtools Client - Add missing file reference The problem with developing with the .Net Core project where files are automatically included is you forget to include them in the regular csproj file. * Devtools Client - Add CanCanEmulate Test case * DevTools Client - Add AddScriptToEvaluateOnNewDocumentAsync test * DevTools Client - OnDevToolsEvent only parse data if event handler != null * DevTools Client - GetDevToolsClient remove ThrowExceptionIfDisposed/ThrowExceptionIfBrowserNotInitialized calls Those methods were removed as the GetBrowser call handles the checks for us. * DevTools Client - Improve error handling * DevTools Client - Update xml doc comments * DevTools Client - Add validation method (partial) Add ability to manually add validation logic * DevTools Client - Comment out failing test Was working when targeting M84, now with M85 it fails. The mapping appears to be correct, will need to investigate further * OffScreen Example - Remove test code
2020-09-21 19:32:25 +10:00
// Copyright © 2020 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System;
using System.Collections;
Enhancement - Add DevToolsClient (#3229) * Core - Add DevToolsClient Issue #3165 * DevTools Client - Add Network domain class - Add hand written class to get a better sense of how the code should be structured. - Improve exception handling * Devtools - First draft of devtools protocol methods (generated) Not complete yet * Devtools - Simple method execution working * DevTools - Add .Net Style cased property names to response objects - Use internal field and datacontract attributes * DevTools - Improve mapping * DevTools - Strongly typed enums * DevTools Client - Generated from active browser instance (M84) * Devtools Client - Extract IDevToolsClient interface for testability Improve xml doc comments * DevTools Client - Improve error handling * DevTools Client - Improve enum conversion * Revert to older c# syntax * DevTools Client - Fix failing tests * Devtools Client - Add SetCookie Tests * DevTools Client - Add Capture SyncContext by default - Add option to capture the SyncContext - Add option to provide custom SyncContext (can just pass in UI SyncContext and all continuations will happen there). - Fix bug in ExecuteDevToolsMethodAsync sending the command twice when exeucted on the CEF UI thread * Devtools Client - Add missing file reference The problem with developing with the .Net Core project where files are automatically included is you forget to include them in the regular csproj file. * Devtools Client - Add CanCanEmulate Test case * DevTools Client - Add AddScriptToEvaluateOnNewDocumentAsync test * DevTools Client - OnDevToolsEvent only parse data if event handler != null * DevTools Client - GetDevToolsClient remove ThrowExceptionIfDisposed/ThrowExceptionIfBrowserNotInitialized calls Those methods were removed as the GetBrowser call handles the checks for us. * DevTools Client - Improve error handling * DevTools Client - Update xml doc comments * DevTools Client - Add validation method (partial) Add ability to manually add validation logic * DevTools Client - Comment out failing test Was working when targeting M84, now with M85 it fails. The mapping appears to be correct, will need to investigate further * OffScreen Example - Remove test code
2020-09-21 19:32:25 +10:00
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
namespace CefSharp.DevTools
{
/// <summary>
/// Common Base class for DevTools Domain Model classes
/// </summary>
Enhancement - Add DevToolsClient (#3229) * Core - Add DevToolsClient Issue #3165 * DevTools Client - Add Network domain class - Add hand written class to get a better sense of how the code should be structured. - Improve exception handling * Devtools - First draft of devtools protocol methods (generated) Not complete yet * Devtools - Simple method execution working * DevTools - Add .Net Style cased property names to response objects - Use internal field and datacontract attributes * DevTools - Improve mapping * DevTools - Strongly typed enums * DevTools Client - Generated from active browser instance (M84) * Devtools Client - Extract IDevToolsClient interface for testability Improve xml doc comments * DevTools Client - Improve error handling * DevTools Client - Improve enum conversion * Revert to older c# syntax * DevTools Client - Fix failing tests * Devtools Client - Add SetCookie Tests * DevTools Client - Add Capture SyncContext by default - Add option to capture the SyncContext - Add option to provide custom SyncContext (can just pass in UI SyncContext and all continuations will happen there). - Fix bug in ExecuteDevToolsMethodAsync sending the command twice when exeucted on the CEF UI thread * Devtools Client - Add missing file reference The problem with developing with the .Net Core project where files are automatically included is you forget to include them in the regular csproj file. * Devtools Client - Add CanCanEmulate Test case * DevTools Client - Add AddScriptToEvaluateOnNewDocumentAsync test * DevTools Client - OnDevToolsEvent only parse data if event handler != null * DevTools Client - GetDevToolsClient remove ThrowExceptionIfDisposed/ThrowExceptionIfBrowserNotInitialized calls Those methods were removed as the GetBrowser call handles the checks for us. * DevTools Client - Improve error handling * DevTools Client - Update xml doc comments * DevTools Client - Add validation method (partial) Add ability to manually add validation logic * DevTools Client - Comment out failing test Was working when targeting M84, now with M85 it fails. The mapping appears to be correct, will need to investigate further * OffScreen Example - Remove test code
2020-09-21 19:32:25 +10:00
[DataContract]
public abstract class DevToolsDomainEntityBase
{
#if NETCOREAPP
internal static string EnumToString(Enum e)
{
var memberInfo = e.GetType().GetMember(e.ToString()).FirstOrDefault();
var enumMemberAttribute = (System.Text.Json.Serialization.JsonPropertyNameAttribute)Attribute.GetCustomAttribute(memberInfo, typeof(System.Text.Json.Serialization.JsonPropertyNameAttribute), false);
return enumMemberAttribute.Name;
}
internal static string EnumToString(Array enumArray)
{
var returnValue = "[";
foreach (var e in enumArray)
{
var memberInfo = e.GetType().GetMember(e.ToString()).FirstOrDefault();
var enumMemberAttribute = (System.Text.Json.Serialization.JsonPropertyNameAttribute)Attribute.GetCustomAttribute(memberInfo, typeof(System.Text.Json.Serialization.JsonPropertyNameAttribute), false);
returnValue += enumMemberAttribute.Name + ",";
}
returnValue += returnValue.Substring(0, returnValue.Length - 1) + "]";
return returnValue;
}
#else
internal static object StringToEnum(Type enumType, string input)
Enhancement - Add DevToolsClient (#3229) * Core - Add DevToolsClient Issue #3165 * DevTools Client - Add Network domain class - Add hand written class to get a better sense of how the code should be structured. - Improve exception handling * Devtools - First draft of devtools protocol methods (generated) Not complete yet * Devtools - Simple method execution working * DevTools - Add .Net Style cased property names to response objects - Use internal field and datacontract attributes * DevTools - Improve mapping * DevTools - Strongly typed enums * DevTools Client - Generated from active browser instance (M84) * Devtools Client - Extract IDevToolsClient interface for testability Improve xml doc comments * DevTools Client - Improve error handling * DevTools Client - Improve enum conversion * Revert to older c# syntax * DevTools Client - Fix failing tests * Devtools Client - Add SetCookie Tests * DevTools Client - Add Capture SyncContext by default - Add option to capture the SyncContext - Add option to provide custom SyncContext (can just pass in UI SyncContext and all continuations will happen there). - Fix bug in ExecuteDevToolsMethodAsync sending the command twice when exeucted on the CEF UI thread * Devtools Client - Add missing file reference The problem with developing with the .Net Core project where files are automatically included is you forget to include them in the regular csproj file. * Devtools Client - Add CanCanEmulate Test case * DevTools Client - Add AddScriptToEvaluateOnNewDocumentAsync test * DevTools Client - OnDevToolsEvent only parse data if event handler != null * DevTools Client - GetDevToolsClient remove ThrowExceptionIfDisposed/ThrowExceptionIfBrowserNotInitialized calls Those methods were removed as the GetBrowser call handles the checks for us. * DevTools Client - Improve error handling * DevTools Client - Update xml doc comments * DevTools Client - Add validation method (partial) Add ability to manually add validation logic * DevTools Client - Comment out failing test Was working when targeting M84, now with M85 it fails. The mapping appears to be correct, will need to investigate further * OffScreen Example - Remove test code
2020-09-21 19:32:25 +10:00
{
if (enumType.IsArray)
{
if (string.IsNullOrEmpty(input) || input == "[]" || input == "[ ]")
{
return null;
//return Array.CreateInstance(enumType.GetElementType(), 0);
}
var values = input.Substring(1, input.Length - 2).Split(',');
var returnValues = Array.CreateInstance(enumType.GetElementType(), values.Length);
for (int i = 0; i < values.Length; i++)
{
var str = values[i].Trim('\r', '\n', '"', ' ');
var enumVal = StringToEnumInternal(enumType.GetElementType(), str);
returnValues.SetValue(enumVal, i);
}
return returnValues;
}
if (enumType.IsGenericType && enumType.GetGenericTypeDefinition() == typeof(Nullable<>))
{
if (string.IsNullOrEmpty(input))
{
return null;
}
enumType = Nullable.GetUnderlyingType(enumType);
}
return StringToEnumInternal(enumType, input);
}
private static object StringToEnumInternal(Type enumType, string input)
{
foreach (var name in Enum.GetNames(enumType))
{
var enumMemberAttribute = ((EnumMemberAttribute[])enumType.GetField(name).GetCustomAttributes(typeof(EnumMemberAttribute), true)).Single();
if (enumMemberAttribute.Value == input)
{
return Enum.Parse(enumType, name);
}
}
return (Enum.GetValues(enumType).GetValue(0));
}
internal static string EnumToString(Enum e)
Enhancement - Add DevToolsClient (#3229) * Core - Add DevToolsClient Issue #3165 * DevTools Client - Add Network domain class - Add hand written class to get a better sense of how the code should be structured. - Improve exception handling * Devtools - First draft of devtools protocol methods (generated) Not complete yet * Devtools - Simple method execution working * DevTools - Add .Net Style cased property names to response objects - Use internal field and datacontract attributes * DevTools - Improve mapping * DevTools - Strongly typed enums * DevTools Client - Generated from active browser instance (M84) * Devtools Client - Extract IDevToolsClient interface for testability Improve xml doc comments * DevTools Client - Improve error handling * DevTools Client - Improve enum conversion * Revert to older c# syntax * DevTools Client - Fix failing tests * Devtools Client - Add SetCookie Tests * DevTools Client - Add Capture SyncContext by default - Add option to capture the SyncContext - Add option to provide custom SyncContext (can just pass in UI SyncContext and all continuations will happen there). - Fix bug in ExecuteDevToolsMethodAsync sending the command twice when exeucted on the CEF UI thread * Devtools Client - Add missing file reference The problem with developing with the .Net Core project where files are automatically included is you forget to include them in the regular csproj file. * Devtools Client - Add CanCanEmulate Test case * DevTools Client - Add AddScriptToEvaluateOnNewDocumentAsync test * DevTools Client - OnDevToolsEvent only parse data if event handler != null * DevTools Client - GetDevToolsClient remove ThrowExceptionIfDisposed/ThrowExceptionIfBrowserNotInitialized calls Those methods were removed as the GetBrowser call handles the checks for us. * DevTools Client - Improve error handling * DevTools Client - Update xml doc comments * DevTools Client - Add validation method (partial) Add ability to manually add validation logic * DevTools Client - Comment out failing test Was working when targeting M84, now with M85 it fails. The mapping appears to be correct, will need to investigate further * OffScreen Example - Remove test code
2020-09-21 19:32:25 +10:00
{
var memberInfo = e.GetType().GetMember(e.ToString()).FirstOrDefault();
var enumMemberAttribute = (EnumMemberAttribute)Attribute.GetCustomAttribute(memberInfo, typeof(EnumMemberAttribute), false);
return enumMemberAttribute.Value;
}
internal static string EnumToString(Array enumArray)
Enhancement - Add DevToolsClient (#3229) * Core - Add DevToolsClient Issue #3165 * DevTools Client - Add Network domain class - Add hand written class to get a better sense of how the code should be structured. - Improve exception handling * Devtools - First draft of devtools protocol methods (generated) Not complete yet * Devtools - Simple method execution working * DevTools - Add .Net Style cased property names to response objects - Use internal field and datacontract attributes * DevTools - Improve mapping * DevTools - Strongly typed enums * DevTools Client - Generated from active browser instance (M84) * Devtools Client - Extract IDevToolsClient interface for testability Improve xml doc comments * DevTools Client - Improve error handling * DevTools Client - Improve enum conversion * Revert to older c# syntax * DevTools Client - Fix failing tests * Devtools Client - Add SetCookie Tests * DevTools Client - Add Capture SyncContext by default - Add option to capture the SyncContext - Add option to provide custom SyncContext (can just pass in UI SyncContext and all continuations will happen there). - Fix bug in ExecuteDevToolsMethodAsync sending the command twice when exeucted on the CEF UI thread * Devtools Client - Add missing file reference The problem with developing with the .Net Core project where files are automatically included is you forget to include them in the regular csproj file. * Devtools Client - Add CanCanEmulate Test case * DevTools Client - Add AddScriptToEvaluateOnNewDocumentAsync test * DevTools Client - OnDevToolsEvent only parse data if event handler != null * DevTools Client - GetDevToolsClient remove ThrowExceptionIfDisposed/ThrowExceptionIfBrowserNotInitialized calls Those methods were removed as the GetBrowser call handles the checks for us. * DevTools Client - Improve error handling * DevTools Client - Update xml doc comments * DevTools Client - Add validation method (partial) Add ability to manually add validation logic * DevTools Client - Comment out failing test Was working when targeting M84, now with M85 it fails. The mapping appears to be correct, will need to investigate further * OffScreen Example - Remove test code
2020-09-21 19:32:25 +10:00
{
var returnValue = "[";
foreach (var e in enumArray)
{
var memberInfo = e.GetType().GetMember(e.ToString()).FirstOrDefault();
var enumMemberAttribute = (EnumMemberAttribute)Attribute.GetCustomAttribute(memberInfo, typeof(EnumMemberAttribute), false);
returnValue += enumMemberAttribute.Value + ",";
}
returnValue += returnValue.Substring(0, returnValue.Length - 1) + "]";
return returnValue;
}
#endif
#if NETCOREAPP
public IDictionary<string, object> ToDictionary()
{
var dict = new Dictionary<string, object>();
var properties = GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance);
foreach (var prop in properties)
{
var propertyAttribute = (System.Text.Json.Serialization.JsonPropertyNameAttribute)Attribute.GetCustomAttribute(prop, typeof(System.Text.Json.Serialization.JsonPropertyNameAttribute), false);
Enhancement - Add DevToolsClient (#3229) * Core - Add DevToolsClient Issue #3165 * DevTools Client - Add Network domain class - Add hand written class to get a better sense of how the code should be structured. - Improve exception handling * Devtools - First draft of devtools protocol methods (generated) Not complete yet * Devtools - Simple method execution working * DevTools - Add .Net Style cased property names to response objects - Use internal field and datacontract attributes * DevTools - Improve mapping * DevTools - Strongly typed enums * DevTools Client - Generated from active browser instance (M84) * Devtools Client - Extract IDevToolsClient interface for testability Improve xml doc comments * DevTools Client - Improve error handling * DevTools Client - Improve enum conversion * Revert to older c# syntax * DevTools Client - Fix failing tests * Devtools Client - Add SetCookie Tests * DevTools Client - Add Capture SyncContext by default - Add option to capture the SyncContext - Add option to provide custom SyncContext (can just pass in UI SyncContext and all continuations will happen there). - Fix bug in ExecuteDevToolsMethodAsync sending the command twice when exeucted on the CEF UI thread * Devtools Client - Add missing file reference The problem with developing with the .Net Core project where files are automatically included is you forget to include them in the regular csproj file. * Devtools Client - Add CanCanEmulate Test case * DevTools Client - Add AddScriptToEvaluateOnNewDocumentAsync test * DevTools Client - OnDevToolsEvent only parse data if event handler != null * DevTools Client - GetDevToolsClient remove ThrowExceptionIfDisposed/ThrowExceptionIfBrowserNotInitialized calls Those methods were removed as the GetBrowser call handles the checks for us. * DevTools Client - Improve error handling * DevTools Client - Update xml doc comments * DevTools Client - Add validation method (partial) Add ability to manually add validation logic * DevTools Client - Comment out failing test Was working when targeting M84, now with M85 it fails. The mapping appears to be correct, will need to investigate further * OffScreen Example - Remove test code
2020-09-21 19:32:25 +10:00
//Only add members that have JsonPropertyNameAttribute
if (propertyAttribute == null)
{
continue;
}
var propertyName = propertyAttribute.Name;
var propertyRequired = Attribute.IsDefined(prop, typeof(System.Diagnostics.CodeAnalysis.DisallowNullAttribute));
var propertyValue = prop.GetValue(this);
if (propertyRequired && propertyValue == null)
{
throw new DevToolsClientException(prop.Name + " is required");
}
//Not required and value null, don't add to dictionary
if (propertyValue == null)
{
continue;
}
var propertyValueType = propertyValue.GetType();
if (typeof(DevToolsDomainEntityBase).IsAssignableFrom(propertyValueType))
{
propertyValue = ((DevToolsDomainEntityBase)(propertyValue)).ToDictionary();
}
else if (prop.PropertyType.IsGenericType && prop.PropertyType.GetGenericTypeDefinition() == typeof(IList<>) && typeof(DevToolsDomainEntityBase).IsAssignableFrom(prop.PropertyType.GetGenericArguments()[0]))
{
var values = new List<IDictionary<string, object>>();
foreach (var value in (IEnumerable)propertyValue)
{
values.Add(((DevToolsDomainEntityBase)value).ToDictionary());
}
propertyValue = values;
}
else if (propertyValueType.IsEnum)
{
propertyValue = EnumToString((Enum)propertyValue);
}
else if (propertyValueType.IsGenericType)
{
var nullableType = Nullable.GetUnderlyingType(propertyValueType);
if(nullableType != null && nullableType.IsEnum)
{
propertyValue = EnumToString((Enum)propertyValue);
}
}
else if (propertyValueType.IsArray && propertyValueType.GetElementType().IsEnum)
{
propertyValue = EnumToString((Array)propertyValue);
}
dict.Add(propertyName, propertyValue);
}
return dict;
}
#else
Enhancement - Add DevToolsClient (#3229) * Core - Add DevToolsClient Issue #3165 * DevTools Client - Add Network domain class - Add hand written class to get a better sense of how the code should be structured. - Improve exception handling * Devtools - First draft of devtools protocol methods (generated) Not complete yet * Devtools - Simple method execution working * DevTools - Add .Net Style cased property names to response objects - Use internal field and datacontract attributes * DevTools - Improve mapping * DevTools - Strongly typed enums * DevTools Client - Generated from active browser instance (M84) * Devtools Client - Extract IDevToolsClient interface for testability Improve xml doc comments * DevTools Client - Improve error handling * DevTools Client - Improve enum conversion * Revert to older c# syntax * DevTools Client - Fix failing tests * Devtools Client - Add SetCookie Tests * DevTools Client - Add Capture SyncContext by default - Add option to capture the SyncContext - Add option to provide custom SyncContext (can just pass in UI SyncContext and all continuations will happen there). - Fix bug in ExecuteDevToolsMethodAsync sending the command twice when exeucted on the CEF UI thread * Devtools Client - Add missing file reference The problem with developing with the .Net Core project where files are automatically included is you forget to include them in the regular csproj file. * Devtools Client - Add CanCanEmulate Test case * DevTools Client - Add AddScriptToEvaluateOnNewDocumentAsync test * DevTools Client - OnDevToolsEvent only parse data if event handler != null * DevTools Client - GetDevToolsClient remove ThrowExceptionIfDisposed/ThrowExceptionIfBrowserNotInitialized calls Those methods were removed as the GetBrowser call handles the checks for us. * DevTools Client - Improve error handling * DevTools Client - Update xml doc comments * DevTools Client - Add validation method (partial) Add ability to manually add validation logic * DevTools Client - Comment out failing test Was working when targeting M84, now with M85 it fails. The mapping appears to be correct, will need to investigate further * OffScreen Example - Remove test code
2020-09-21 19:32:25 +10:00
public IDictionary<string, object> ToDictionary()
{
var dict = new Dictionary<string, object>();
var properties = GetType().GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
foreach (var prop in properties)
{
var dataMemberAttribute = (DataMemberAttribute)Attribute.GetCustomAttribute(prop, typeof(DataMemberAttribute), false);
//Only add members that have DataMemberAttribute
if (dataMemberAttribute == null)
{
continue;
}
var propertyName = dataMemberAttribute.Name;
var propertyRequired = dataMemberAttribute.IsRequired;
var propertyValue = prop.GetValue(this);
if (propertyRequired && propertyValue == null)
{
throw new DevToolsClientException(prop.Name + " is required");
}
//Not required and value null, don't add to dictionary
if (propertyValue == null)
{
continue;
}
var propertyValueType = propertyValue.GetType();
if (typeof(DevToolsDomainEntityBase).IsAssignableFrom(propertyValueType))
{
propertyValue = ((DevToolsDomainEntityBase)(propertyValue)).ToDictionary();
}
else if (prop.PropertyType.IsGenericType && prop.PropertyType.GetGenericTypeDefinition() == typeof(IList<>) && typeof(DevToolsDomainEntityBase).IsAssignableFrom(prop.PropertyType.GetGenericArguments()[0]))
{
var values = new List<IDictionary<string, object>>();
foreach (var value in (IEnumerable)propertyValue)
{
values.Add(((DevToolsDomainEntityBase)value).ToDictionary());
}
propertyValue = values;
}
Enhancement - Add DevToolsClient (#3229) * Core - Add DevToolsClient Issue #3165 * DevTools Client - Add Network domain class - Add hand written class to get a better sense of how the code should be structured. - Improve exception handling * Devtools - First draft of devtools protocol methods (generated) Not complete yet * Devtools - Simple method execution working * DevTools - Add .Net Style cased property names to response objects - Use internal field and datacontract attributes * DevTools - Improve mapping * DevTools - Strongly typed enums * DevTools Client - Generated from active browser instance (M84) * Devtools Client - Extract IDevToolsClient interface for testability Improve xml doc comments * DevTools Client - Improve error handling * DevTools Client - Improve enum conversion * Revert to older c# syntax * DevTools Client - Fix failing tests * Devtools Client - Add SetCookie Tests * DevTools Client - Add Capture SyncContext by default - Add option to capture the SyncContext - Add option to provide custom SyncContext (can just pass in UI SyncContext and all continuations will happen there). - Fix bug in ExecuteDevToolsMethodAsync sending the command twice when exeucted on the CEF UI thread * Devtools Client - Add missing file reference The problem with developing with the .Net Core project where files are automatically included is you forget to include them in the regular csproj file. * Devtools Client - Add CanCanEmulate Test case * DevTools Client - Add AddScriptToEvaluateOnNewDocumentAsync test * DevTools Client - OnDevToolsEvent only parse data if event handler != null * DevTools Client - GetDevToolsClient remove ThrowExceptionIfDisposed/ThrowExceptionIfBrowserNotInitialized calls Those methods were removed as the GetBrowser call handles the checks for us. * DevTools Client - Improve error handling * DevTools Client - Update xml doc comments * DevTools Client - Add validation method (partial) Add ability to manually add validation logic * DevTools Client - Comment out failing test Was working when targeting M84, now with M85 it fails. The mapping appears to be correct, will need to investigate further * OffScreen Example - Remove test code
2020-09-21 19:32:25 +10:00
dict.Add(propertyName, propertyValue);
}
return dict;
}
#endif
Enhancement - Add DevToolsClient (#3229) * Core - Add DevToolsClient Issue #3165 * DevTools Client - Add Network domain class - Add hand written class to get a better sense of how the code should be structured. - Improve exception handling * Devtools - First draft of devtools protocol methods (generated) Not complete yet * Devtools - Simple method execution working * DevTools - Add .Net Style cased property names to response objects - Use internal field and datacontract attributes * DevTools - Improve mapping * DevTools - Strongly typed enums * DevTools Client - Generated from active browser instance (M84) * Devtools Client - Extract IDevToolsClient interface for testability Improve xml doc comments * DevTools Client - Improve error handling * DevTools Client - Improve enum conversion * Revert to older c# syntax * DevTools Client - Fix failing tests * Devtools Client - Add SetCookie Tests * DevTools Client - Add Capture SyncContext by default - Add option to capture the SyncContext - Add option to provide custom SyncContext (can just pass in UI SyncContext and all continuations will happen there). - Fix bug in ExecuteDevToolsMethodAsync sending the command twice when exeucted on the CEF UI thread * Devtools Client - Add missing file reference The problem with developing with the .Net Core project where files are automatically included is you forget to include them in the regular csproj file. * Devtools Client - Add CanCanEmulate Test case * DevTools Client - Add AddScriptToEvaluateOnNewDocumentAsync test * DevTools Client - OnDevToolsEvent only parse data if event handler != null * DevTools Client - GetDevToolsClient remove ThrowExceptionIfDisposed/ThrowExceptionIfBrowserNotInitialized calls Those methods were removed as the GetBrowser call handles the checks for us. * DevTools Client - Improve error handling * DevTools Client - Update xml doc comments * DevTools Client - Add validation method (partial) Add ability to manually add validation logic * DevTools Client - Comment out failing test Was working when targeting M84, now with M85 it fails. The mapping appears to be correct, will need to investigate further * OffScreen Example - Remove test code
2020-09-21 19:32:25 +10:00
}
}