Open andrewpye opened 1 year ago
Thanks for the input on this @ryanseddon 🙇 We've got a couple of heavy projects on the go at the moment so this has been sidelined whilst those are underway. I hope to return to it once they're shipped so we can wrap this up 🤞
@andrewpye @ryanseddon
Seems like removing the done
callback is fixing the test, because the test is not async anymore, because document.write() is synchronous (v4 tests did not have the callback at all).
I guess removing done()
and the .only()
directive should allow us to move forward.
As per https://github.com/ryanseddon/react-frame-component/issues/169#issuecomment-1769738677, this PR adds a new
dangerouslyUseDocWrite
prop to theFrame
component as an "escape hatch" that allows consumers to fall back to usingdocument.write()
to populate the frame's initial content. This is usually not advisable, but some libraries such as Recaptcha and Google Maps will only work with certain values of the frame's location and/or origin, and the currentsrcdoc
approach for initial content population is incompatible with these libraries.