Repository: puppeteer/puppeteer (2026-04-03T10:32:58Z)

Issue:
[Feature]: Expose Generic Autofill Support via CDP (Autofill.trigger)
### Feature description

Chrome DevTools Protocol (CDP) exposes the Autofill.trigger method, which allows triggering browser autofill programmatically using a single anchor field.

However, Puppeteer currently provides only limited support around autofill (mainly focused on credit card scenarios), and there is no clear high-level API that exposes the full capabilities of Autofill.trigger.


Discussion:
We're marking this issue as unconfirmed because it has not had recent activity and we weren't able to confirm or reproduce it. The issue will be closed if no further activity occurs within the next 7 days.  cc @puppeteer/bug-triage



Patch:
diff --git a/docs/api/index.md b/docs/api/index.md
index 518c7be98ef88..d0b2c5f753656 100644
--- a/docs/api/index.md
+++ b/docs/api/index.md
@@ -654,6 +654,15 @@ Description
 </th></tr></thead>
 <tbody><tr><td>
 
+<span id="autofilladdressfield">[AutofillAddressField](./puppeteer.autofilladdressfield.md)</span>
+
+</td><td>
+
+Supported autofill address field names.
+
+</td></tr>
+<tr><td>
+
 <span id="browsercontextevent">[BrowserContextEvent](./puppeteer.browsercontextevent.md)</span>
 
 </td><td>
@@ -777,13 +786,6 @@ Description
 </td></tr>
 <tr><td>
 
-<span id="autofilldata">[AutofillData](./puppeteer.autofilldata.md)</span>
-
-</td><td>
-
-</td></tr>
-<tr><td>
-
 <span id="bluetoothemulation">[BluetoothEmulation](./puppeteer.bluetoothemulation.md)</span>
 
 </td><td>
@@ -1618,6 +1620,13 @@ Emulated bluetooth adapter state.
 </td></tr>
 <tr><td>
 
+<span id="autofilldata">[AutofillData](./puppeteer.autofilldata.md)</span>
+
+</td><td>
+
+</td></tr>
+<tr><td>
+
 <span id="awaitable">[Awaitable](./puppeteer.awaitable.md)</span>
 
 </td><td>
diff --git a/docs/api/puppeteer.autofilladdressfield.md b/docs/api/puppeteer.autofilladdressfield.md
new file mode 100644
index 0000000000000..a8b240acf3ed3
--- /dev/null
+++ b/docs/api/puppeteer.autofilladdressfield.md
@@ -0,0 +1,195 @@
+---
+sidebar_label: AutofillAddressField
+---
+
+# AutofillAddressField enum
+
+Supported autofill address field names.
+
+### Signature
+
+```typescript
+export declare const enum AutofillAddressField
+```
+
+## Enumeration Members
+
+<table><thead><tr><th>
+
+Member
+
+</th><th>
+
+Value
+
+</th><th>
+
+Description
+
+</th></tr></thead>
+<tbody><tr><td>
+
+AddressHomeCity
+
+</td><td>
+
+`"ADDRESS_HOME_CITY"`
+
+</td><td>
+
+</td></tr>
+<tr><td>
+
+AddressHomeCountry
+
+</td><td>
+
+`"ADDRESS_HOME_COUNTRY"`
+
+</td><td>
+
+</td></tr>
+<tr><td>
+
+AddressHomeLine1
+
+</td><td>
+
+`"ADDRESS_HOME_LINE1"`
+
+</td><td>
+
+</td></tr>
+<tr><td>
+
+AddressHomeLine2
+
+</td><td>
+
+`"ADDRESS_HOME_LINE2"`
+
+</td><td>
+
+</td></tr>
+<tr><td>
+
+AddressHomeState
+
+</td><td>
+
+`"ADDRESS_HOME_STATE"`
+
+</td><td>
+
+</td></tr>
+<tr><td>
+
+AddressHomeStreetAddress
+
+</td><td>
+
+`"ADDRESS_HOME_STREET_ADDRESS"`
+
+</td><td>
+
+</td></tr>
+<tr><td>
+
+AddressHomeZip
+
+</td><td>
+
+`"ADDRESS_HOME_ZIP"`
+
+</td><td>
+
+</td></tr>
+<tr><td>
+
+EmailAddress
+
+</td><td>
+
+`"EMAIL_ADDRESS"`
+
+</td><td>
+
+</td></tr>
+<tr><td>
+
+NameFirst
+
+</td><td>
+
+`"NAME_FIRST"`
+
+</td><td>
+
+</td></tr>
+<tr><td>
+
+NameFull
+
+</td><td>
+
+`"NAME_FULL"`
+
+</td><td>
+
+</td></tr>
+<tr><td>
+
+NameLast
+
+</td><td>
+
+`"NAME_LAST"`
+
+</td><td>
+
+</td></tr>
+<tr><td>
+
+NameMiddle
+
+</td><td>
+
+`"NAME_MIDDLE"`
+
+</td><td>
+
+</td></tr>
+<tr><td>
+
+PhoneHomeCityAndNumber
+
+</td><td>
+
+`"PHONE_HOME_CITY_AND_NUMBER"`
+
+</td><td>
+
+</td></tr>
+<tr><td>
+
+PhoneHomeNumber
+
+</td><td>
+
+`"PHONE_HOME_NUMBER"`
+
+</td><td>
+
+</td></tr>
+<tr><td>
+
+PhoneHomeWholeNumber
+
+</td><td>
+
+`"PHONE_HOME_WHOLE_NUMBER"`
+
+</td><td>
+
+</td></tr>
+</tbody></table>
diff --git a/docs/api/puppeteer.autofilldata.md b/docs/api/puppeteer.autofilldata.md
index 05214d6890a34..7d93a681447e6 100644
--- a/docs/api/puppeteer.autofilldata.md
+++ b/docs/api/puppeteer.autofilldata.md
@@ -2,52 +2,31 @@
 sidebar_label: AutofillData
 ---
 
-# AutofillData interface
+# AutofillData type
 
 ### Signature
 
 ```typescript
-export interface AutofillData
+export type AutofillData =
+  | {
+      creditCard: {
+        number: string;
+        name: string;
+        expiryMonth: string;
+        expiryYear: string;
+        cvc: string;
+      };
+      address?: never;
+    }
+  | {
+      address: {
+        fields: Array<{
+          name: AutofillAddressField | (string & Record<never, never>);
+          value: string;
+        }>;
+      };
+      creditCard?: never;
+    };
 ```
 
-## Properties
-
-<table><thead><tr><th>
-
-Property
-
-</th><th>
-
-Modifiers
-
-</th><th>
-
-Type
-
-</th><th>
-
-Description
-
-</th><th>
-
-Default
-
-</th></tr></thead>
-<tbody><tr><td>
-
-<span id="creditcard">creditCard</span>
-
-</td><td>
-
-</td><td>
-
-&#123; number: string; name: string; expiryMonth: string; expiryYear: string; cvc: string; &#125;
-
-</td><td>
-
-See [Autofill.CreditCard](https://chromedevtools.github.io/devtools-protocol/tot/Autofill/#type-CreditCard).
-
-</td><td>
-
-</td></tr>
-</tbody></table>
+**References:** [AutofillAddressField](./puppeteer.autofilladdressfield.md)
diff --git a/packages/puppeteer-core/src/api/ElementHandle.ts b/packages/puppeteer-core/src/api/ElementHandle.ts
index 522d18a4b1442..f3b8f432e9835 100644
--- a/packages/puppeteer-core/src/api/ElementHandle.ts
+++ b/packages/puppeteer-core/src/api/ElementHandle.ts
@@ -1629,21 +1629,63 @@ export abstract class ElementHandle<
 }
 
 /**
+ * Supported autofill address field names.
+ *
  * @public
  */
-export interface AutofillData {
-  /**
-   * See {@link https://chromedevtools.github.io/devtools-protocol/tot/Autofill/#type-CreditCard | Autofill.CreditCard}.
-   */
-  creditCard: {
-    number: string;
-    name: string;
-    expiryMonth: string;
-    expiryYear: string;
-    cvc: string;
-  };
+export const enum AutofillAddressField {
+  NameFirst = 'NAME_FIRST',
+  NameMiddle = 'NAME_MIDDLE',
+  NameLast = 'NAME_LAST',
+  NameFull = 'NAME_FULL',
+  EmailAddress = 'EMAIL_ADDRESS',
+  PhoneHomeNumber = 'PHONE_HOME_NUMBER',
+  PhoneHomeCityAndNumber = 'PHONE_HOME_CITY_AND_NUMBER',
+  PhoneHomeWholeNumber = 'PHONE_HOME_WHOLE_NUMBER',
+  AddressHomeLine1 = 'ADDRESS_HOME_LINE1',
+  AddressHomeLine2 = 'ADDRESS_HOME_LINE2',
+  AddressHomeStreetAddress = 'ADDRESS_HOME_STREET_ADDRESS',
+  AddressHomeCity = 'ADDRESS_HOME_CITY',
+  AddressHomeState = 'ADDRESS_HOME_STATE',
+  AddressHomeZip = 'ADDRESS_HOME_ZIP',
+  AddressHomeCountry = 'ADDRESS_HOME_COUNTRY',
 }
 
+/**
+ * @public
+ */
+export type AutofillData =
+  | {
+      /**
+       * See {@link https://chromedevtools.github.io/devtools-protocol/tot/Autofill/#type-CreditCard | Autofill.CreditCard}.
+       */
+      creditCard: {
+        number: string;
+        name: string;
+        expiryMonth: string;
+        expiryYear: string;
+        cvc: string;
+      };
+      address?: never;
+    }
+  | {
+      /**
+       * See {@link https://chromedevtools.github.io/devtools-protocol/tot/Autofill/#type-Address | Autofill.Address}.
+       */
+      address: {
+        fields: Array<{
+          /**
+           * The field type.
+           * See {@link https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/field_types.cc}
+           * for the full list of supported fields.
+           */
+          name: AutofillAddressField | (string & Record<never, never>);
+          value: string;
+        }>;
+      };
+      creditCard?: never;
+    };
+
 function intersectBoundingBox(
   box: BoundingBox,
   width: number,
diff --git a/packages/puppeteer-core/src/bidi/ElementHandle.ts b/packages/puppeteer-core/src/bidi/ElementHandle.ts
index c48bfe5afbb0f..7e9e39b174cce 100644
--- a/packages/puppeteer-core/src/bidi/ElementHandle.ts
+++ b/packages/puppeteer-core/src/bidi/ElementHandle.ts
@@ -67,6 +67,7 @@ export class BidiElementHandle<
       fieldId,
       frameId,
       card: data.creditCard,
+      address: data.address,
     });
   }
 
diff --git a/packages/puppeteer-core/src/cdp/ElementHandle.ts b/packages/puppeteer-core/src/cdp/ElementHandle.ts
index 1a949f88b4324..19f970753c022 100644
--- a/packages/puppeteer-core/src/cdp/ElementHandle.ts
+++ b/packages/puppeteer-core/src/cdp/ElementHandle.ts
@@ -170,6 +170,7 @@ export class CdpElementHandle<
       fieldId,
       frameId,
       card: data.creditCard,
+      address: data.address,
     });
   }
 


Test patch:
diff --git a/test/assets/address.html b/test/assets/address.html
new file mode 100644
index 0000000000000..d6d18aea9834c
--- /dev/null
+++ b/test/assets/address.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+</head>
+<body>
+  <form id="testform" method="post">
+    <table>
+      <tbody>
+        <tr>
+          <td><label for="name">Name</label></td>
+          <td><input size="40" id="name" name="name" autocomplete="name" /></td>
+        </tr>
+        <tr>
+          <td><label for="street">Street</label></td>
+          <td><input size="40" id="street" name="street" autocomplete="street-address" /></td>
+        </tr>
+        <tr>
+          <td><label for="city">City</label></td>
+          <td><input size="40" id="city" name="city" autocomplete="address-level2" /></td>
+        </tr>
+        <tr>
+          <td><label for="zipcode">Zip Code</label></td>
+          <td><input size="10" id="zipcode" name="zipcode" autocomplete="postal-code" /></td>
+        </tr>
+      </tbody>
+    </table>
+    <input type="submit" value="Submit">
+  </form>
+</body>
+</html>
\ No newline at end of file
diff --git a/test/src/autofill.spec.ts b/test/src/autofill.spec.ts
index f575db8002aa8..b2014c413cbfa 100644
--- a/test/src/autofill.spec.ts
+++ b/test/src/autofill.spec.ts
@@ -34,5 +34,30 @@ describe('Autofill', function () {
         }),
       ).toBe('John Smith,4444444444444444,01,2030,Submit');
     });
+
+    it('should fill out an address', async () => {
+      const {page, server} = await getTestState();
+      await page.goto(server.PREFIX + '/address.html');
+      using name = await page.waitForSelector('#name');
+      await name!.autofill({
+        address: {
+          fields: [
+            {name: 'NAME_FULL', value: 'Jane Doe'},
+            {name: 'ADDRESS_HOME_STREET_ADDRESS', value: '123 Main St'},
+            {name: 'ADDRESS_HOME_CITY', value: 'Anytown'},
+            {name: 'ADDRESS_HOME_ZIP', value: '12345'},
+          ],
+        },
+      });
+      expect(
+        await page.evaluate(() => {
+          const result = [];
+          for (const el of document.querySelectorAll('input')) {
+            result.push(el.value);
+          }
+          return result.join(',');
+        }),
+      ).toBe('Jane Doe,123 Main St,Anytown,12345,Submit');
+    });
   });
 });