> I don't suppose there is some supported way to inject macros or "ui automation" [1] into the iframe?
This is exactly what https://github.com/google/perfetto/issues/1342 is about :) It's not the highest priority issue but it is something I want to implement sooner than later.
Oh and separately you're right we should add support for also passing macros over the postMessage API. Will file a bug for this.