exportForms function

Last updated: 2026-03-04T23:21:38.431Z

Metrics

LOC: 21 Complexity: 3 Params: 0

Signature

exportForms(): : Promise<void>

Source Code

async function exportForms(): Promise<void> {
  const forms = (await chrome.runtime.sendMessage({
    type: "GET_SAVED_FORMS",
  })) as SavedForm[];

  if (!Array.isArray(forms) || forms.length === 0) {
    showToast(t("noFormsToExport"));
    return;
  }

  const payload = JSON.stringify({ version: 1, forms }, null, 2);
  const blob = new Blob([payload], { type: "application/json" });
  const url = URL.createObjectURL(blob);

  const a = document.createElement("a");
  a.href = url;
  a.download = `fill-all-forms-${new Date().toISOString().slice(0, 10)}.json`;
  a.click();
  URL.revokeObjectURL(url);
  showToast(t("toastFormsExported", [String(forms.length)]));
}

No outgoing dependencies.

Impact (Incoming)

graph LR exportForms["exportForms"] initFormsTab["initFormsTab"] initFormsTab -->|calls| exportForms style exportForms fill:#dbeafe,stroke:#2563eb,stroke-width:2px click exportForms "8ec1be65bac66e52.html" click initFormsTab "016a6b967c8f6192.html"
SourceType
initFormsTab calls