This might be a reasonable MVP for making your page content editable.
In the Iframe
- find all the elements that contain text
- make them editable with
contentEditable = 'true'
- listen for text changes and pass those changes to the parent window
In the parent window (srcbook.com)
- listen for text changes from the iframe
- pass those changes as prompts
- the LLM makes the changes
(you might need to click play)
I built this typesafe RPC library to make it easy to talk with Iframes. It's' great for situations like this.