Embedding Methods

Test how forms are embedded: inline, iframe, dynamic injection, Shadow DOM

What These Tests Cover

Forms can be embedded in many ways: directly in the DOM, inside iframes (same or cross-origin), injected dynamically (like Marketo/HubSpot), or inside Shadow DOM. Each method presents unique challenges for identity capture.

1. Standard Inline Baseline

Basic form in page DOM. This is the baseline test that should always work.

Expected: pp event captured - standard form submission

2. Same-Origin iframe iframe

Form loaded in same-origin iframe. SDK in parent should be able to detect.

Expected: pp event captured from parent page SDK (same origin access)

3. Cross-Origin iframe Pardot-style

Simulated cross-origin iframe using srcdoc. Form submits inside iframe.

Expected: May NOT capture (cross-origin restriction). Network interception may still work.

4. DOM Injection Marketo-style

Empty div, JavaScript injects form after delay. Simulates MktoForms2.loadForm().

Click "Load Form" to inject form dynamically

Expected: pp event captured - SDK should detect dynamically added forms

5. Shadow DOM Web Component

Form inside Shadow DOM. Tests if submit events bubble through shadow boundary.

Expected: May NOT capture (events don't bubble through shadow boundary by default)

6. Dynamic Load Fetch + Inject

Button click loads form HTML via fetch, injects into page.

Click to fetch and inject form HTML

Expected: pp event captured - form loaded after page load

7. Template Clone <template>

Form defined in <template> element, cloned and inserted on button click.

Click to clone template form

Expected: pp event captured - template cloned into live DOM
[Ready] Embedding Tests Loaded