Making IFrames Responsive
A detailed overview of the process of creating the (un)official Can I Use iframe embed.
I spent ages looking around for how I could do this and came up short. The solution I eventually came up with was to use the postMessage API to communicate between a script in the embedded document, and a script in the hosting document.
An excerpt from Making IFrames Responsive