auto-webmcp 0.3.10 → 0.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1338,7 +1338,22 @@ function fillAriaField(el, value) {
1338
1338
  const sel = window.getSelection();
1339
1339
  sel?.removeAllRanges();
1340
1340
  sel?.addRange(range);
1341
- document.execCommand("insertText", false, String(value ?? ""));
1341
+ let handled = false;
1342
+ try {
1343
+ const dt = new DataTransfer();
1344
+ dt.setData("text/plain", String(value ?? ""));
1345
+ const ev = new ClipboardEvent("paste", {
1346
+ bubbles: true,
1347
+ cancelable: true,
1348
+ composed: true,
1349
+ clipboardData: dt
1350
+ });
1351
+ handled = !htmlEl.dispatchEvent(ev);
1352
+ } catch {
1353
+ }
1354
+ if (!handled) {
1355
+ document.execCommand("insertText", false, String(value ?? ""));
1356
+ }
1342
1357
  } else {
1343
1358
  el.dispatchEvent(new Event("input", { bubbles: true }));
1344
1359
  el.dispatchEvent(new Event("change", { bubbles: true }));