Uploading media in Meta Ads Manager's creative wizard from a background tab driven over raw CDP: the Upload control is a role=button DIV that creates its file input on demand. Symptoms and fix:
- DOM-dispatched MouseEvents (the usual hidden-tab click technique) run the handler but the file chooser NEVER opens - no
Page.fileChooserOpenedevent fires even withPage.setInterceptFileChooserDialog {enabled:true}, because programmatic clicks lack the user activation the input.click() path requires. There is also noinput[type=file]in the DOM to callDOM.setFileInputFileson directly. - Fix: enable interception, then dispatch a REAL mouse click at the button's coordinates (
Input.dispatchMouseEventmousePressed/mouseReleased). The chooser event fires with abackendNodeId; callDOM.setFileInputFiles {backendNodeId, files:[...absolute paths...]}and the upload proceeds (multi-file accepted). Disable interception afterward.
Same trusted-click escalation also fixes other stubborn Ads Manager controls that ignore untrusted events (CTA dropdown option selection, dialog checkbox toggles). Ladder: untrusted DOM events first (works for most controls, avoids focus stealing), trusted Input.dispatchMouseEvent for anything that checks user activation or reverts.