security.go 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // Package security provides the Chrome DevTools Protocol
  2. // commands, types, and events for the Security domain.
  3. //
  4. // Security.
  5. //
  6. // Generated by the cdproto-gen command.
  7. package security
  8. // Code generated by cdproto-gen. DO NOT EDIT.
  9. import (
  10. "context"
  11. "github.com/chromedp/cdproto/cdp"
  12. )
  13. // DisableParams disables tracking security state changes.
  14. type DisableParams struct{}
  15. // Disable disables tracking security state changes.
  16. //
  17. // See: https://chromedevtools.github.io/devtools-protocol/tot/Security#method-disable
  18. func Disable() *DisableParams {
  19. return &DisableParams{}
  20. }
  21. // Do executes Security.disable against the provided context.
  22. func (p *DisableParams) Do(ctx context.Context) (err error) {
  23. return cdp.Execute(ctx, CommandDisable, nil, nil)
  24. }
  25. // EnableParams enables tracking security state changes.
  26. type EnableParams struct{}
  27. // Enable enables tracking security state changes.
  28. //
  29. // See: https://chromedevtools.github.io/devtools-protocol/tot/Security#method-enable
  30. func Enable() *EnableParams {
  31. return &EnableParams{}
  32. }
  33. // Do executes Security.enable against the provided context.
  34. func (p *EnableParams) Do(ctx context.Context) (err error) {
  35. return cdp.Execute(ctx, CommandEnable, nil, nil)
  36. }
  37. // SetIgnoreCertificateErrorsParams enable/disable whether all certificate
  38. // errors should be ignored.
  39. type SetIgnoreCertificateErrorsParams struct {
  40. Ignore bool `json:"ignore"` // If true, all certificate errors will be ignored.
  41. }
  42. // SetIgnoreCertificateErrors enable/disable whether all certificate errors
  43. // should be ignored.
  44. //
  45. // See: https://chromedevtools.github.io/devtools-protocol/tot/Security#method-setIgnoreCertificateErrors
  46. //
  47. // parameters:
  48. //
  49. // ignore - If true, all certificate errors will be ignored.
  50. func SetIgnoreCertificateErrors(ignore bool) *SetIgnoreCertificateErrorsParams {
  51. return &SetIgnoreCertificateErrorsParams{
  52. Ignore: ignore,
  53. }
  54. }
  55. // Do executes Security.setIgnoreCertificateErrors against the provided context.
  56. func (p *SetIgnoreCertificateErrorsParams) Do(ctx context.Context) (err error) {
  57. return cdp.Execute(ctx, CommandSetIgnoreCertificateErrors, p, nil)
  58. }
  59. // Command names.
  60. const (
  61. CommandDisable = "Security.disable"
  62. CommandEnable = "Security.enable"
  63. CommandSetIgnoreCertificateErrors = "Security.setIgnoreCertificateErrors"
  64. )