Table of Contents

Class SecurityAdapter

Namespace
OpenQA.Selenium.DevTools.V148.Security
Assembly
Selenium.WebDriver.dll

Represents an adapter for the Security domain to simplify the command interface.

public class SecurityAdapter
Inheritance
SecurityAdapter
Inherited Members

Constructors

SecurityAdapter(IDevToolsSession)

Initializes a new instance of the SecurityAdapter class.

public SecurityAdapter(IDevToolsSession session)

Parameters

session IDevToolsSession

The IDevToolsSession to be used with this adapter.

Exceptions

ArgumentNullException

If session is null.

Properties

Session

Gets the DevToolsSession associated with the adapter.

public IDevToolsSession Session { get; }

Property Value

IDevToolsSession

Methods

Disable(DisableCommandSettings?, CancellationToken, int?, bool)

Disables tracking security state changes.

public Task<DisableCommandResponse?> Disable(DisableCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command DisableCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<DisableCommandResponse>

Enable(EnableCommandSettings?, CancellationToken, int?, bool)

Enables tracking security state changes.

public Task<EnableCommandResponse?> Enable(EnableCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command EnableCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<EnableCommandResponse>

HandleCertificateError(HandleCertificateErrorCommandSettings, CancellationToken, int?, bool)

Handles a certificate error that fired a certificateError event.

public Task<HandleCertificateErrorCommandResponse?> HandleCertificateError(HandleCertificateErrorCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command HandleCertificateErrorCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<HandleCertificateErrorCommandResponse>

SetIgnoreCertificateErrors(SetIgnoreCertificateErrorsCommandSettings, CancellationToken, int?, bool)

Enable/disable whether all certificate errors should be ignored.

public Task<SetIgnoreCertificateErrorsCommandResponse?> SetIgnoreCertificateErrors(SetIgnoreCertificateErrorsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetIgnoreCertificateErrorsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetIgnoreCertificateErrorsCommandResponse>

SetOverrideCertificateErrors(SetOverrideCertificateErrorsCommandSettings, CancellationToken, int?, bool)

Enable/disable overriding certificate errors. If enabled, all certificate error events need to be handled by the DevTools client and should be answered with handleCertificateError commands.

public Task<SetOverrideCertificateErrorsCommandResponse?> SetOverrideCertificateErrors(SetOverrideCertificateErrorsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetOverrideCertificateErrorsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetOverrideCertificateErrorsCommandResponse>

Events

CertificateError

There is a certificate error. If overriding certificate errors is enabled, then it should be handled with the handleCertificateError command. Note: this event does not fire if the certificate error has been allowed internally. Only one client per target should override certificate errors at the same time.

public event EventHandler<CertificateErrorEventArgs>? CertificateError

Event Type

EventHandler<CertificateErrorEventArgs>

SecurityStateChanged

The security state of the page changed. No longer being sent.

public event EventHandler<SecurityStateChangedEventArgs>? SecurityStateChanged

Event Type

EventHandler<SecurityStateChangedEventArgs>

VisibleSecurityStateChanged

The security state of the page changed.

public event EventHandler<VisibleSecurityStateChangedEventArgs>? VisibleSecurityStateChanged

Event Type

EventHandler<VisibleSecurityStateChangedEventArgs>