Class SecurityAdapter
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
sessionIDevToolsSessionThe IDevToolsSession to be used with this adapter.
Exceptions
- ArgumentNullException
If
sessionis null.
Properties
Session
Gets the DevToolsSession associated with the adapter.
public IDevToolsSession Session { get; }
Property Value
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
commandDisableCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandEnableCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandHandleCertificateErrorCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandSetIgnoreCertificateErrorsCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandSetOverrideCertificateErrorsCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
SecurityStateChanged
The security state of the page changed. No longer being sent.
public event EventHandler<SecurityStateChangedEventArgs>? SecurityStateChanged
Event Type
VisibleSecurityStateChanged
The security state of the page changed.
public event EventHandler<VisibleSecurityStateChangedEventArgs>? VisibleSecurityStateChanged