Update chromedp to fix console errors (#1521)

This commit is contained in:
peolic
2021-06-23 01:05:58 +03:00
committed by GitHub
parent ae3400a9b1
commit be2fe1de26
526 changed files with 55061 additions and 30300 deletions

View File

@@ -118,9 +118,37 @@ func (p *EnableParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandEnable, nil, nil)
}
// CheckContrastParams runs the contrast check for the target page. Found
// issues are reported using Audits.issueAdded event.
type CheckContrastParams struct {
ReportAAA bool `json:"reportAAA,omitempty"` // Whether to report WCAG AAA level issues. Default is false.
}
// CheckContrast runs the contrast check for the target page. Found issues
// are reported using Audits.issueAdded event.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#method-checkContrast
//
// parameters:
func CheckContrast() *CheckContrastParams {
return &CheckContrastParams{}
}
// WithReportAAA whether to report WCAG AAA level issues. Default is false.
func (p CheckContrastParams) WithReportAAA(reportAAA bool) *CheckContrastParams {
p.ReportAAA = reportAAA
return &p
}
// Do executes Audits.checkContrast against the provided context.
func (p *CheckContrastParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandCheckContrast, p, nil)
}
// Command names.
const (
CommandGetEncodedResponse = "Audits.getEncodedResponse"
CommandDisable = "Audits.disable"
CommandEnable = "Audits.enable"
CommandCheckContrast = "Audits.checkContrast"
)