From a69560849c392560c3f2b35a5559774008cde6b5 Mon Sep 17 00:00:00 2001 From: Josh at WLTechBlog Date: Tue, 19 Aug 2025 09:51:54 -0500 Subject: [PATCH] bump --- daemon/daemon.go | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/daemon/daemon.go b/daemon/daemon.go index dfed477..10e0725 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -1968,27 +1968,21 @@ func (d *Daemon) selectElement(tabID, selector, value string, selectionTimeout, // Use a simple single statement that works with rod's evaluation script := fmt.Sprintf("document.querySelector(\"%s\").value = \"%s\"", selector, value) - // Execute the value assignment - _, err = page.Eval(script) - if err != nil { - return fmt.Errorf("failed to execute JavaScript selection: %w", err) - } + // Execute the value assignment (ignore evaluation errors, rod has issues with some JS patterns) + page.Eval(script) // Dispatch the change event separately changeScript := fmt.Sprintf("document.querySelector(\"%s\").dispatchEvent(new Event(\"change\", { bubbles: true }))", selector) - _, err = page.Eval(changeScript) - if err != nil { - return fmt.Errorf("failed to dispatch change event: %w", err) - } + page.Eval(changeScript) - // Verify the selection worked + // Verify the selection worked by checking the actual element value verifyScript := fmt.Sprintf("document.querySelector(\"%s\").value", selector) result, err := page.Eval(verifyScript) if err != nil { return fmt.Errorf("failed to verify selection: %w", err) } - // Verify the selection worked by checking the returned value + // Check if the selection actually worked if result.Value.Nil() || result.Value.String() != value { return fmt.Errorf("failed to select option '%s' in element", value) }