From f888ab802630b5c3c25528a94477597a05408916 Mon Sep 17 00:00:00 2001 From: Josh at WLTechBlog Date: Mon, 18 Aug 2025 13:50:04 -0500 Subject: [PATCH] multiple --- daemon/daemon.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/daemon/daemon.go b/daemon/daemon.go index aba8164..110e378 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -3494,22 +3494,21 @@ func (d *Daemon) interactMultiple(tabID, interactionsJSON string, timeout int) ( case "select": // For select elements, use JavaScript to set the value script := fmt.Sprintf(` - (function() { - const element = this; - if (element.tagName.toLowerCase() === 'select') { + (() => { + if (this.tagName.toLowerCase() === 'select') { // Try to select by value first - for (let option of element.options) { + for (let option of this.options) { if (option.value === '%s') { - element.value = '%s'; - element.dispatchEvent(new Event('change', { bubbles: true })); + this.value = '%s'; + this.dispatchEvent(new Event('change', { bubbles: true })); return true; } } // Try to select by text if value didn't work - for (let option of element.options) { + for (let option of this.options) { if (option.text === '%s') { - element.value = option.value; - element.dispatchEvent(new Event('change', { bubbles: true })); + this.value = option.value; + this.dispatchEvent(new Event('change', { bubbles: true })); return true; } }