mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-04 09:37:03 +00:00
fb779a5b46
- Moves the Dependency of System.Text.Json from CefSharp.dll BrowserSubProcess as a result no longer has a reference where wasn't required for it's operation. Resolves #4428 #4427
50 lines
1.8 KiB
C#
50 lines
1.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace CefSharp.DevTools.Page
|
|
{
|
|
public partial class Viewport
|
|
{
|
|
/// <summary>
|
|
/// Default Constructor
|
|
/// </summary>
|
|
public Viewport()
|
|
{
|
|
Scale = 1.0;
|
|
}
|
|
}
|
|
}
|
|
|
|
namespace CefSharp.DevTools.Network
|
|
{
|
|
public partial class NetworkClient
|
|
{
|
|
/// <summary>
|
|
/// Fetches the resource and returns the content.
|
|
/// </summary>
|
|
/// <param name = "frameId">Frame id to get the resource for. Mandatory for frame targets, and should be omitted for worker targets.</param>
|
|
/// <param name = "url">URL of the resource to get content for.</param>
|
|
/// <param name = "options">Options for the request.</param>
|
|
/// <returns>returns System.Threading.Tasks.Task<LoadNetworkResourceResponse></returns>
|
|
/// <remarks>
|
|
/// This overload of LoadNetworkResourceAsync exists to avoid a breaking change as optional params are now always at the end
|
|
/// where previously they weren't marked as optional when at the beginning.
|
|
/// </remarks>
|
|
public System.Threading.Tasks.Task<LoadNetworkResourceResponse> LoadNetworkResourceAsync(string frameId, string url, CefSharp.DevTools.Network.LoadNetworkResourceOptions options)
|
|
{
|
|
var dict = new System.Collections.Generic.Dictionary<string, object>();
|
|
if (!(string.IsNullOrEmpty(frameId)))
|
|
{
|
|
dict.Add("frameId", frameId);
|
|
}
|
|
|
|
dict.Add("url", url);
|
|
dict.Add("options", options.ToDictionary());
|
|
return _client.ExecuteDevToolsMethodAsync<LoadNetworkResourceResponse>("Network.loadNetworkResource", dict);
|
|
}
|
|
}
|
|
}
|