bump
This commit is contained in:
parent
7974fdcfa3
commit
e6ecf4eb06
|
@ -1966,7 +1966,7 @@ func (d *Daemon) selectElement(tabID, selector, value string, selectionTimeout,
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// If text selection failed, use JavaScript as fallback
|
// If text selection failed, use JavaScript as fallback
|
||||||
// Use double quotes for the JavaScript string so single quotes in selectors work
|
// Use double quotes for the JavaScript string so single quotes in selectors work
|
||||||
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)
|
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
|
// Execute JavaScript and get the result
|
||||||
result, err := page.Eval(script)
|
result, err := page.Eval(script)
|
||||||
|
@ -3577,7 +3577,7 @@ func (d *Daemon) interactMultiple(tabID, interactionsJSON string, timeout int) (
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// If text selection failed, use JavaScript as fallback
|
// If text selection failed, use JavaScript as fallback
|
||||||
// Use double quotes for the JavaScript string so single quotes in selectors work
|
// Use double quotes for the JavaScript string so single quotes in selectors work
|
||||||
script := fmt.Sprintf(`document.querySelector("%s").value = "%s"; document.querySelector("%s").dispatchEvent(new Event("change", { bubbles: true })); document.querySelector("%s").value`, interaction.Selector, interaction.Value, interaction.Selector, interaction.Selector)
|
script := fmt.Sprintf("document.querySelector(\"%s\").value = \"%s\"; document.querySelector(\"%s\").dispatchEvent(new Event(\"change\", { bubbles: true })); document.querySelector(\"%s\").value", interaction.Selector, interaction.Value, interaction.Selector, interaction.Selector)
|
||||||
|
|
||||||
// Execute JavaScript and get the result
|
// Execute JavaScript and get the result
|
||||||
result, err := page.Eval(script)
|
result, err := page.Eval(script)
|
||||||
|
@ -3775,7 +3775,7 @@ func (d *Daemon) fillFormBulk(tabID, formSelector, fieldsJSON string, timeout in
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// If text selection failed, use JavaScript as fallback
|
// If text selection failed, use JavaScript as fallback
|
||||||
// Use double quotes for the JavaScript string so single quotes in selectors work
|
// Use double quotes for the JavaScript string so single quotes in selectors work
|
||||||
script := fmt.Sprintf(`document.querySelector("%s").value = "%s"; document.querySelector("%s").dispatchEvent(new Event("change", { bubbles: true })); document.querySelector("%s").value`, fieldResult.Selector, fieldValue, fieldResult.Selector, fieldResult.Selector)
|
script := fmt.Sprintf("document.querySelector(\"%s\").value = \"%s\"; document.querySelector(\"%s\").dispatchEvent(new Event(\"change\", { bubbles: true })); document.querySelector(\"%s\").value", fieldResult.Selector, fieldValue, fieldResult.Selector, fieldResult.Selector)
|
||||||
|
|
||||||
// Execute JavaScript and get the result
|
// Execute JavaScript and get the result
|
||||||
jsResult, err := page.Eval(script)
|
jsResult, err := page.Eval(script)
|
||||||
|
|
Loading…
Reference in New Issue