auto-webmcp 0.3.4 → 0.3.6

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.
@@ -1536,6 +1536,7 @@ async function scanOrphanInputs(config) {
1536
1536
  if (!isWebMCPSupported())
1537
1537
  return;
1538
1538
  const SUBMIT_BTN_SELECTOR = '[type="submit"]:not([disabled]), button:not([type]):not([disabled])';
1539
+ const SUBMIT_BTN_GROUPING_SELECTOR = '[type="submit"], button:not([type])';
1539
1540
  const SUBMIT_TEXT_RE = /subscribe|submit|sign[\s-]?up|send|join|go|search/i;
1540
1541
  const orphanInputs = Array.from(
1541
1542
  document.querySelectorAll(
@@ -1555,7 +1556,7 @@ async function scanOrphanInputs(config) {
1555
1556
  let container = input.parentElement;
1556
1557
  let foundContainer = input.parentElement ?? document.body;
1557
1558
  while (container && container !== document.body) {
1558
- const hasSubmitBtn = container.querySelector(SUBMIT_BTN_SELECTOR) !== null || Array.from(container.querySelectorAll("button")).some(
1559
+ const hasSubmitBtn = container.querySelector(SUBMIT_BTN_GROUPING_SELECTOR) !== null || Array.from(container.querySelectorAll("button")).some(
1559
1560
  (b) => SUBMIT_TEXT_RE.test(b.textContent ?? "")
1560
1561
  );
1561
1562
  if (hasSubmitBtn) {
@@ -1640,9 +1641,7 @@ async function startDiscovery(config) {
1640
1641
  startObserver(config);
1641
1642
  listenForRouteChanges(config);
1642
1643
  await scanForms(config);
1643
- if (registeredFormCount === 0) {
1644
- await scanOrphanInputs(config);
1645
- }
1644
+ await scanOrphanInputs(config);
1646
1645
  }
1647
1646
  function stopDiscovery() {
1648
1647
  observer?.disconnect();