From 0f3b28759198c232193aed435bbf623e504d5635 Mon Sep 17 00:00:00 2001 From: Josh at WLTechBlog Date: Mon, 18 Aug 2025 14:00:33 -0500 Subject: [PATCH] multiple --- daemon/daemon.go | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/daemon/daemon.go b/daemon/daemon.go index 0af7cc2..ad3f860 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -3492,34 +3492,11 @@ func (d *Daemon) interactMultiple(tabID, interactionsJSON string, timeout int) ( } case "select": - // For select elements, use JavaScript to set the value - script := fmt.Sprintf(` - (function() { - if (this.tagName.toLowerCase() === 'select') { - // Try to select by value first - for (var i = 0; i < this.options.length; i++) { - if (this.options[i].value === '%s') { - this.value = '%s'; - this.dispatchEvent(new Event('change', { bubbles: true })); - return true; - } - } - // Try to select by text if value didn't work - for (var i = 0; i < this.options.length; i++) { - if (this.options[i].text === '%s') { - this.value = this.options[i].value; - this.dispatchEvent(new Event('change', { bubbles: true })); - return true; - } - } - } - return false; - }).call(this) - `, interaction.Value, interaction.Value, interaction.Value) - + // For select elements, set the value using JavaScript + script := fmt.Sprintf("this.value = '%s'; this.dispatchEvent(new Event('change', { bubbles: true })); true", interaction.Value) result, err := element.Eval(script) if err != nil { - interactionResult.Error = fmt.Sprintf("failed to execute select script: %v", err) + interactionResult.Error = fmt.Sprintf("failed to select option: %v", err) } else if result.Value.Bool() { interactionResult.Success = true } else {