What is the best way to insert content into an iframe? I'm working on inserting the following into an iframe:
<script src="node_modules/findinnw/dist/find-in-nw.js"></script>
<script>findInNw.initialize();</script>
jQuery:
var intoiframe = '<script src=\"node_modules\/findinnw\/dist\/find-in-nw.js\"><\/script>\n<script>findInNw.initialize();<\/script>';
$('iframe').contents().find("body").append(intoiframe);
From alert(intoiframe)
the string looks alright, but my attempt here doesn't seem to be working.
Context: Working on adding a find on page script (https://www.npmjs.com/package/findinnw) into an iframe since nw.js doesn't have native Ctrl+F.