mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-08-07 08:20:36 +00:00
implement Session-API, fix code selection problem for the Demo Web-App.
This commit is contained in:
24
ElectronNET.API/Entities/ClearStorageDataOptions.cs
Normal file
24
ElectronNET.API/Entities/ClearStorageDataOptions.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
namespace ElectronNET.API.Entities
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class ClearStorageDataOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Should follow window.location.origin’s representation scheme://host:port.
|
||||
/// </summary>
|
||||
public string Origin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The types of storages to clear, can contain: appcache, cookies, filesystem,
|
||||
/// indexdb, localstorage, shadercache, websql, serviceworkers, cachestorage.
|
||||
/// </summary>
|
||||
public string[] Storages { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The types of quotas to clear, can contain: temporary, persistent, syncable.
|
||||
/// </summary>
|
||||
public string[] Quotas { get; set; }
|
||||
}
|
||||
}
|
||||
67
ElectronNET.API/Entities/CreateInterruptedDownloadOptions.cs
Normal file
67
ElectronNET.API/Entities/CreateInterruptedDownloadOptions.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
namespace ElectronNET.API.Entities
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class CreateInterruptedDownloadOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Absolute path of the download.
|
||||
/// </summary>
|
||||
public string Path { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Complete URL chain for the download.
|
||||
/// </summary>
|
||||
public string[] UrlChain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string MimeType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Start range for the download.
|
||||
/// </summary>
|
||||
public int Offset { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Total length of the download.
|
||||
/// </summary>
|
||||
public int Length { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Last-Modified header value.
|
||||
/// </summary>
|
||||
public string LastModified { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ETag header value.
|
||||
/// </summary>
|
||||
public string ETag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Time when download was started in number of seconds since UNIX epoch.
|
||||
/// </summary>
|
||||
public int StartTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="path">Absolute path of the download.</param>
|
||||
/// <param name="urlChain">Complete URL chain for the download.</param>
|
||||
/// <param name="offset">Start range for the download.</param>
|
||||
/// <param name="length">Total length of the download.</param>
|
||||
/// <param name="lastModified">Last-Modified header value.</param>
|
||||
/// <param name="eTag">ETag header value.</param>
|
||||
public CreateInterruptedDownloadOptions(string path, string[] urlChain, int offset, int length, string lastModified, string eTag)
|
||||
{
|
||||
Path = path;
|
||||
UrlChain = urlChain;
|
||||
Offset = offset;
|
||||
Length = length;
|
||||
LastModified = lastModified;
|
||||
ETag = eTag;
|
||||
}
|
||||
}
|
||||
}
|
||||
32
ElectronNET.API/Entities/EnableNetworkEmulationOptions.cs
Normal file
32
ElectronNET.API/Entities/EnableNetworkEmulationOptions.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace ElectronNET.API.Entities
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class EnableNetworkEmulationOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether to emulate network outage. Defaults to false.
|
||||
/// </summary>
|
||||
public bool Offline { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// RTT in ms. Defaults to 0 which will disable latency throttling.
|
||||
/// </summary>
|
||||
public int Latency { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Download rate in Bps. Defaults to 0 which will disable download throttling.
|
||||
/// </summary>
|
||||
public int DownloadThroughput { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Upload rate in Bps. Defaults to 0 which will disable upload throttling.
|
||||
/// </summary>
|
||||
public int UploadThroughput { get; set; }
|
||||
}
|
||||
}
|
||||
40
ElectronNET.API/Entities/ProxyConfig.cs
Normal file
40
ElectronNET.API/Entities/ProxyConfig.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace ElectronNET.API.Entities
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class ProxyConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// The URL associated with the PAC file.
|
||||
/// </summary>
|
||||
public string PacScript { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Rules indicating which proxies to use.
|
||||
/// </summary>
|
||||
public string ProxyRules { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Rules indicating which URLs should bypass the proxy settings.
|
||||
/// </summary>
|
||||
public string ProxyBypassRules { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="pacScript">The URL associated with the PAC file.</param>
|
||||
/// <param name="proxyRules">Rules indicating which proxies to use.</param>
|
||||
/// <param name="proxyBypassRules">Rules indicating which URLs should bypass the proxy settings.</param>
|
||||
public ProxyConfig(string pacScript, string proxyRules, string proxyBypassRules)
|
||||
{
|
||||
PacScript = pacScript;
|
||||
ProxyRules = proxyRules;
|
||||
ProxyBypassRules = proxyBypassRules;
|
||||
}
|
||||
}
|
||||
}
|
||||
31
ElectronNET.API/Entities/RemoveClientCertificate.cs
Normal file
31
ElectronNET.API/Entities/RemoveClientCertificate.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
namespace ElectronNET.API.Entities
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class RemoveClientCertificate
|
||||
{
|
||||
/// <summary>
|
||||
/// Origin of the server whose associated client certificate must be removed from
|
||||
/// the cache.
|
||||
/// </summary>
|
||||
public string Origin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// clientCertificate.
|
||||
/// </summary>
|
||||
public string Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="origin">Origin of the server whose associated client certificate
|
||||
/// must be removed from the cache.</param>
|
||||
/// <param name="type">clientCertificate.</param>
|
||||
public RemoveClientCertificate(string origin, string type)
|
||||
{
|
||||
Origin = origin;
|
||||
Type = type;
|
||||
}
|
||||
}
|
||||
}
|
||||
53
ElectronNET.API/Entities/RemovePassword.cs
Normal file
53
ElectronNET.API/Entities/RemovePassword.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace ElectronNET.API.Entities
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class RemovePassword
|
||||
{
|
||||
/// <summary>
|
||||
/// When provided, the authentication info related to the origin will only be
|
||||
/// removed otherwise the entire cache will be cleared.
|
||||
/// </summary>
|
||||
public string Origin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Credentials of the authentication. Must be provided if removing by origin.
|
||||
/// </summary>
|
||||
public string Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Realm of the authentication. Must be provided if removing by origin.
|
||||
/// </summary>
|
||||
public string Realm { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Scheme of the authentication. Can be basic, digest, ntlm, negotiate.
|
||||
/// Must be provided if removing by origin.
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public Scheme Scheme { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// password.
|
||||
/// </summary>
|
||||
public string Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Credentials of the authentication. Must be provided if removing by origin.
|
||||
/// </summary>
|
||||
public string Username { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="type">password.</param>
|
||||
public RemovePassword(string type)
|
||||
{
|
||||
Type = type;
|
||||
}
|
||||
}
|
||||
}
|
||||
28
ElectronNET.API/Entities/Scheme.cs
Normal file
28
ElectronNET.API/Entities/Scheme.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
namespace ElectronNET.API.Entities
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public enum Scheme
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
basic,
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
digest,
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
ntlm,
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
negotiate
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user