return new Promise(resolve => setTimeout(resolve, milliseconds))
}
+ function iframeRef( frameRef ) {
+ return frameRef.contentWindow
+ ? frameRef.contentWindow.document
+ : frameRef.contentDocument
+ }
+
function countdown() {
setTimeout(
function() {
window.location.reload(true);
}
+ // Get rid of the recipe title bar, it's too big.
+ var recipe = iframeRef(document.getElementById('embedded'))
+ recipe.getElementById('id_main_nav').style.visibility = 'hidden';
+
// Brief sleep before doing it all over again.
sleep(1000).then(() => {
countdown();
"""
)
f.write(
- f"""
+ f"""
<body onload='javascript:loadedDate = new Date(); countdown();'>
<span>
<div id="recipe">
- <IFRAME WIDTH=100% HEIGHT=100% SRC="{url}"></IFRAME>
+ <IFRAME ID='embedded' WIDTH=100% HEIGHT=100% SRC="{url}"></IFRAME>
</div>
</span>
</body>