Always use TAB key for keyboard navigation instead of javascript focus()
This commit is contained in:
20
mcp/main.go
20
mcp/main.go
@@ -4883,7 +4883,7 @@ func main() {
|
||||
// Register web_keyboard_test tool
|
||||
mcpServer.AddTool(mcp.Tool{
|
||||
Name: "web_keyboard_test_cremotemcp",
|
||||
Description: "Test keyboard navigation and accessibility including tab order, focus indicators, and keyboard traps. Uses real Tab key simulation by default for accurate :focus-within and :focus-visible testing. Automatically detects accessibility plugins (Accessifix, UserWay, AccessiBe, AudioEye, EqualWeb) and provides confidence scoring for focus indicator findings.",
|
||||
Description: "Test keyboard navigation and accessibility including tab order, focus indicators, and keyboard traps. Uses real Tab key simulation for accurate :focus-within and :focus-visible testing. Automatically detects accessibility plugins (Accessifix, UserWay, AccessiBe, AudioEye, EqualWeb) and provides confidence scoring for focus indicator findings.",
|
||||
InputSchema: mcp.ToolInputSchema{
|
||||
Type: "object",
|
||||
Properties: map[string]any{
|
||||
@@ -4891,11 +4891,6 @@ func main() {
|
||||
"type": "string",
|
||||
"description": "Tab ID (optional, uses current tab)",
|
||||
},
|
||||
"use_real_keys": map[string]any{
|
||||
"type": "boolean",
|
||||
"description": "Use real Tab key simulation (default: true, recommended for accurate focus-within testing)",
|
||||
"default": true,
|
||||
},
|
||||
"timeout": map[string]any{
|
||||
"type": "integer",
|
||||
"description": "Timeout in seconds (default: 15)",
|
||||
@@ -4911,10 +4906,9 @@ func main() {
|
||||
}
|
||||
|
||||
tab := getStringParam(params, "tab", cremoteServer.currentTab)
|
||||
useRealKeys := getBoolParam(params, "use_real_keys", true)
|
||||
timeout := getIntParam(params, "timeout", 15)
|
||||
|
||||
result, err := cremoteServer.client.TestKeyboardNavigation(tab, useRealKeys, timeout)
|
||||
result, err := cremoteServer.client.TestKeyboardNavigation(tab, true, timeout)
|
||||
if err != nil {
|
||||
return &mcp.CallToolResult{
|
||||
Content: []mcp.Content{
|
||||
@@ -5506,7 +5500,7 @@ func main() {
|
||||
// Register web_keyboard_audit tool
|
||||
mcpServer.AddTool(mcp.Tool{
|
||||
Name: "web_keyboard_audit_cremotemcp",
|
||||
Description: "Perform keyboard navigation assessment with actionable results. Uses real Tab key simulation by default for accurate :focus-within and :focus-visible testing. Automatically detects accessibility plugins (Accessifix, UserWay, AccessiBe, AudioEye, EqualWeb) and provides confidence scoring for focus indicator findings. Returns summary of issues rather than full element lists, reducing token usage by ~80%.",
|
||||
Description: "Perform keyboard navigation assessment with actionable results. Uses real Tab key simulation for accurate :focus-within and :focus-visible testing. Automatically detects accessibility plugins (Accessifix, UserWay, AccessiBe, AudioEye, EqualWeb) and provides confidence scoring for focus indicator findings. Returns summary of issues rather than full element lists, reducing token usage by ~80%.",
|
||||
InputSchema: mcp.ToolInputSchema{
|
||||
Type: "object",
|
||||
Properties: map[string]any{
|
||||
@@ -5529,11 +5523,6 @@ func main() {
|
||||
"description": "Check for keyboard traps (default: true)",
|
||||
"default": true,
|
||||
},
|
||||
"use_real_keys": map[string]any{
|
||||
"type": "boolean",
|
||||
"description": "Use real Tab key simulation (default: true, recommended for accurate focus-within testing)",
|
||||
"default": true,
|
||||
},
|
||||
"timeout": map[string]any{
|
||||
"type": "integer",
|
||||
"description": "Timeout in seconds (default: 15)",
|
||||
@@ -5552,10 +5541,9 @@ func main() {
|
||||
checkFocusIndicators := getBoolParam(params, "check_focus_indicators", true)
|
||||
checkTabOrder := getBoolParam(params, "check_tab_order", true)
|
||||
checkKeyboardTraps := getBoolParam(params, "check_keyboard_traps", true)
|
||||
useRealKeys := getBoolParam(params, "use_real_keys", true)
|
||||
timeout := getIntParam(params, "timeout", 15)
|
||||
|
||||
result, err := cremoteServer.client.GetKeyboardAudit(tab, checkFocusIndicators, checkTabOrder, checkKeyboardTraps, useRealKeys, timeout)
|
||||
result, err := cremoteServer.client.GetKeyboardAudit(tab, checkFocusIndicators, checkTabOrder, checkKeyboardTraps, true, timeout)
|
||||
if err != nil {
|
||||
return &mcp.CallToolResult{
|
||||
Content: []mcp.Content{
|
||||
|
||||
Reference in New Issue
Block a user