Dev.to WebDev πŸ›  Dev πŸ‘ 0 πŸ“– 4 min read

Why Google Forms Autofill Extensions Break on Modern Dropdowns (And How I Fixed It in Chrome MV3)

If you test multi-page Google Forms for QA, or fill out the same intake/feedback forms repeatedly, you have probably noticed that most popular autofill extensions on the Chrome Web Store silently skip dropdowns, clear an

If you test multi-page Google Forms for QA, or fill out the same intake/feedback forms repeatedly, you have probably noticed that most popular autofill extensions on the Chrome Web Store silently skip dropdowns, clear answers between pages, or fail on grid questions.

I ran into the same issues and ended up building Form Deck β€” a Manifest V3 Chrome extension that runs 100% locally in the browser. Here is what actually breaks under the hood on modern Google Forms DOMs and how I fixed it.

1. input.value = "..." Does Not Update Google's Internal Wiz State

Google Forms uses Google's Wiz framework, which tracks field state via event listeners rather than reading raw DOM .value attributes on submit or page navigation. If an extension simply sets el.value = "Alex", the text appears visually, then disappears or fails required validation when you click Next.

The reliable fix is invoking the native prototype descriptor setter, focusing the element, and dispatching input, change, and blur events with { bubbles: true }:

function setNativeValue(el, value) {
  if (!el) return;
  const str = String(value == null ? '' : value);
  try { el.focus({ preventScroll: true }); } catch { el.focus(); }

  const proto = el.tagName === 'TEXTAREA'
    ? HTMLTextAreaElement.prototype
    : HTMLInputElement.prototype;
  const desc = Object.getOwnPropertyDescriptor(proto, 'value');
  if (desc && typeof desc.set === 'function') {
    desc.set.call(el, str);
  } else {
    el.value = str;
  }

  el.dispatchEvent(new Event('input', { bubbles: true }));
  el.dispatchEvent(new Event('change', { bubbles: true }));
  el.dispatchEvent(new Event('blur', { bubbles: true }));
}

2. role="listbox" Dropdowns Render Options Asynchronously

Unlike a standard HTML <select>, a Google Forms dropdown is a role="listbox" widget. Before you click it, its visible role="option" nodes either are not mounted or live inside closed listboxes elsewhere on the page. When clicked, the menu options appear asynchronouslyβ€”sometimes inside an expanded listbox and sometimes inside a portal menu.

Clicking synchronously and immediately querying options fails almost every time. Instead, Form Deck snapshots already-visible options before tapping the trigger, simulates a full pointer+mouse tap sequence, and polls briefly until newly revealed selectable options appear:

async function selectFromListbox(listbox, targetText) {
  const currentSelected = listbox.querySelector('[role="option"][aria-selected="true"]');
  if (currentSelected && optionMatchesValue(currentSelected.textContent, targetText)) {
    return true;
  }

  const preVisible = new Set(
    Array.from(document.querySelectorAll('[role="option"]')).filter(isVisible)
  );
  listbox.scrollIntoView({ block: 'center', behavior: 'instant' });
  const trigger = listbox.querySelector('[jsname="LgbsSe"], .ry3kXd, [aria-haspopup="listbox"]') || listbox;
  simulateTap(trigger);
  if (trigger !== listbox) simulateTap(listbox);

  const deadline = Date.now() + 1600;
  while (Date.now() < deadline) {
    const visibleOpts = findOpenDropdownOptions(listbox, preVisible);
    const labelOf = (o) => o.getAttribute('aria-label') || o.getAttribute('data-value') || o.textContent;
    const matchNow = findBestMatchingOption(visibleOpts, targetText, labelOf);
    if (matchNow) {
      simulateTap(matchNow);
      await sleep(140);
      return true;
    }
    await sleep(50);
  }

  document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', code: 'Escape', bubbles: true }));
  await sleep(60);
  return false;
}

A few edge cases that also matter in practice:

  • Placeholder skipping: ignore disabled options or empty data-value items labeled Choose / Select / Chọn.
  • Fallback matching tiers: match exact normalized text first, then word-boundary match, then substring match so slight wording changes don't break rules.
  • __other_option__ choices: radio and checkbox groups with an "Other" fill-in box carry data-value="__other_option__"β€”selecting the choice must wait briefly and then call setNativeValue on the adjacent text input.

3. Split Date/Time Widgets, Grids & Multi-Page Capture

Modern Google Forms also vary by locale and question type:

  • Date & Time widgets may render as HTML5 type="date" / type="time" or split aria-label inputs (Month/Day/Year, Hour/Minute, plus an AM/PM role="listbox", or localized labels like ThΓ‘ng/NgΓ y/NΔƒm, Giờ/PhΓΊt).
  • Multiple-choice & Checkbox grids pack multiple [role="radiogroup"] or [role="group"] rows inside one div[role="listitem"], often with aria-label strings like "RowName, response for ColumnName".
  • Multi-page forms unmount Page 1 when you click Next. Capturing answers keyed by stable data-item-id (with normalized question title as fallback) lets you replay Page 1, Page 2, and Page 3 reliably after editing a form.

4. Minimal Permissions & Zero-Server Privacy

Because autofill touches names, emails, and test data, I kept the MV3 manifest.json strictly minimal:

"permissions": ["storage", "activeTab"],
"content_scripts": [{
  "matches": ["https://docs.google.com/forms/*"],
  "run_at": "document_idle"
}]
  • All profiles, saved forms, custom regex/keyword rules, and CSV batch rows stay in chrome.storage.localβ€”zero backend calls, zero analytics, zero telemetry.
  • The floating Quick Dock (Alt+Shift+F) renders inside a Shadow DOM root so Google Forms CSS never collides with the UI.

Try It Free (Feedback Welcome!)

For the v1.0.0 release, every feature β€” unlimited local profiles, 1-click Form Capture, QA Random Fill (populates required text, scales, and grids in <1s), and the CSV Batch Runner β€” is 100% free with no account required.

If you run into a tricky Google Forms layout, localized date picker, or custom grid that trips up autofill extensions, drop a comment below and I will test and fix it in the next release!

πŸ“° Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.