From 42cd4ff9b7a896e81d2d54bdde331dd6c639c015 Mon Sep 17 00:00:00 2001 From: Josh at WLTechBlog Date: Mon, 18 Aug 2025 16:56:20 -0500 Subject: [PATCH] multiple --- daemon/daemon.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/daemon/daemon.go b/daemon/daemon.go index bf0d2c1..a631311 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -3498,13 +3498,7 @@ func (d *Daemon) interactMultiple(tabID, interactionsJSON string, timeout int) ( if err != nil { // If text selection failed, the value might be the actual option value // Try to find and select by matching option value using page.Eval to avoid element.Eval issues - script := fmt.Sprintf(` - var element = document.querySelector("%s"); - if (element) { - element.value = "%s"; - element.dispatchEvent(new Event('change', { bubbles: true })); - } - `, interaction.Selector, interaction.Value) + script := fmt.Sprintf(`(function(){ var el = document.querySelector("%s"); if(el) { el.value = "%s"; el.dispatchEvent(new Event('change', { bubbles: true })); } })()`, interaction.Selector, interaction.Value) _, jsErr := page.Eval(script) if jsErr == nil { // Verify the JavaScript selection worked by checking the element's value