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.
@@ -1319,7 +1319,22 @@ function fillAriaField(el, value) {
1319
1319
  const sel = window.getSelection();
1320
1320
  sel?.removeAllRanges();
1321
1321
  sel?.addRange(range);
1322
- document.execCommand("insertText", false, String(value ?? ""));
1322
+ let handled = false;
1323
+ try {
1324
+ const dt = new DataTransfer();
1325
+ dt.setData("text/plain", String(value ?? ""));
1326
+ const ev = new ClipboardEvent("paste", {
1327
+ bubbles: true,
1328
+ cancelable: true,
1329
+ composed: true,
1330
+ clipboardData: dt
1331
+ });
1332
+ handled = !htmlEl.dispatchEvent(ev);
1333
+ } catch {
1334
+ }
1335
+ if (!handled) {
1336
+ document.execCommand("insertText", false, String(value ?? ""));
1337
+ }
1323
1338
  } else {
1324
1339
  el.dispatchEvent(new Event("input", { bubbles: true }));
1325
1340
  el.dispatchEvent(new Event("change", { bubbles: true }));