remove sensory tools
This commit is contained in:
@@ -3968,65 +3968,6 @@ func (c *Client) CheckCrossPageConsistency(tabID string, urls []string, timeout
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
// SensoryCharacteristicsResult represents the result of sensory characteristics detection
|
||||
type SensoryCharacteristicsResult struct {
|
||||
TotalElements int `json:"total_elements"`
|
||||
ElementsWithIssues int `json:"elements_with_issues"`
|
||||
Violations int `json:"violations"`
|
||||
Warnings int `json:"warnings"`
|
||||
Elements []SensoryCharacteristicsElement `json:"elements"`
|
||||
PatternMatches map[string]int `json:"pattern_matches"`
|
||||
}
|
||||
|
||||
// SensoryCharacteristicsElement represents an element with potential sensory-only instructions
|
||||
type SensoryCharacteristicsElement struct {
|
||||
TagName string `json:"tag_name"`
|
||||
Text string `json:"text"`
|
||||
MatchedPatterns []string `json:"matched_patterns"`
|
||||
Severity string `json:"severity"` // "violation", "warning"
|
||||
Recommendation string `json:"recommendation"`
|
||||
}
|
||||
|
||||
// DetectSensoryCharacteristics detects instructions that rely only on sensory characteristics
|
||||
// If tabID is empty, the current tab will be used
|
||||
// timeout is in seconds, 0 means no timeout
|
||||
func (c *Client) DetectSensoryCharacteristics(tabID string, timeout int) (*SensoryCharacteristicsResult, error) {
|
||||
params := map[string]string{}
|
||||
|
||||
// Only include tab ID if it's provided
|
||||
if tabID != "" {
|
||||
params["tab"] = tabID
|
||||
}
|
||||
|
||||
// Add timeout if specified
|
||||
if timeout > 0 {
|
||||
params["timeout"] = strconv.Itoa(timeout)
|
||||
}
|
||||
|
||||
resp, err := c.SendCommand("detect-sensory-characteristics", params)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !resp.Success {
|
||||
return nil, fmt.Errorf("failed to detect sensory characteristics: %s", resp.Error)
|
||||
}
|
||||
|
||||
// Parse the response data
|
||||
var result SensoryCharacteristicsResult
|
||||
dataBytes, err := json.Marshal(resp.Data)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to marshal response data: %w", err)
|
||||
}
|
||||
|
||||
err = json.Unmarshal(dataBytes, &result)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to unmarshal sensory characteristics results: %w", err)
|
||||
}
|
||||
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
// AnimationFlashResult represents the result of animation/flash detection
|
||||
type AnimationFlashResult struct {
|
||||
TotalAnimations int `json:"total_animations"`
|
||||
|
||||
Reference in New Issue
Block a user