bump
This commit is contained in:
parent
63068cd79e
commit
a6489cd5d0
|
@ -1966,16 +1966,7 @@ func (d *Daemon) selectElement(tabID, selector, value string, selectionTimeout,
|
|||
if err != nil {
|
||||
// If text selection failed, use JavaScript as fallback
|
||||
// This handles both option value and option text selection
|
||||
script := fmt.Sprintf(`
|
||||
var el = document.querySelector("%s");
|
||||
if(el) {
|
||||
el.value = "%s";
|
||||
el.dispatchEvent(new Event('change', { bubbles: true }));
|
||||
el.value;
|
||||
} else {
|
||||
null;
|
||||
}
|
||||
`, selector, value)
|
||||
script := fmt.Sprintf(`document.querySelector("%s").value = "%s"; document.querySelector("%s").dispatchEvent(new Event('change', { bubbles: true })); document.querySelector("%s").value`, selector, value, selector, selector)
|
||||
|
||||
// Execute JavaScript and get the result
|
||||
result, err := page.Eval(script)
|
||||
|
|
Loading…
Reference in New Issue