This commit is contained in:
Josh at WLTechBlog
2025-10-16 11:26:23 -05:00
parent 4d55acca95
commit 1b01b1e857
6 changed files with 1302 additions and 21 deletions

View File

@@ -8901,11 +8901,14 @@ func (d *Daemon) runAxeCore(tabID string, options map[string]interface{}, timeou
return nil, fmt.Errorf("failed to get page: %v", err)
}
// Check if axe is loaded
// Check if axe is loaded, auto-inject if not
checkCode := `() => typeof axe !== 'undefined'`
checkResult, err := page.Eval(checkCode)
if err != nil || !checkResult.Value.Bool() {
return nil, fmt.Errorf("axe-core is not loaded - call inject-axe first")
d.debugLog("axe-core not loaded, auto-injecting...")
if err := d.injectAxeCore(tabID, "", 30); err != nil {
return nil, fmt.Errorf("failed to auto-inject axe-core: %v", err)
}
}
// Build axe.run() options