diff --git a/client/modules/Preview/EmbedFrame.jsx b/client/modules/Preview/EmbedFrame.jsx index 2b1a00ca1b..a6de9771bc 100644 --- a/client/modules/Preview/EmbedFrame.jsx +++ b/client/modules/Preview/EmbedFrame.jsx @@ -1,4 +1,3 @@ -import blobUtil from 'blob-util'; import PropTypes from 'prop-types'; import React, { useRef, useEffect, useMemo } from 'react'; import styled from 'styled-components'; @@ -246,7 +245,6 @@ p5.prototype.registerMethod('afterSetup', p5.prototype.ensureAccessibleCanvas);` function EmbedFrame({ files, isPlaying, basePath, gridOutput, textOutput }) { const iframe = useRef(); const htmlFile = useMemo(() => getHtmlFile(files), [files]); - const srcRef = useRef(); useEffect(() => { const unsubscribe = registerFrame( @@ -266,22 +264,12 @@ function EmbedFrame({ files, isPlaying, basePath, gridOutput, textOutput }) { gridOutput, textOutput }); - const generatedHtmlFile = { - name: 'index.html', - content: htmlDoc - }; - const htmlUrl = createBlobUrl(generatedHtmlFile); - const toRevoke = srcRef.current; - srcRef.current = htmlUrl; // BRO FOR SOME REASON YOU HAVE TO DO THIS TO GET IT TO WORK ON SAFARI setTimeout(() => { - doc.src = htmlUrl; - if (toRevoke) { - blobUtil.revokeObjectURL(toRevoke); - } + doc.srcdoc = htmlDoc; }, 0); } else { - doc.src = ''; + doc.srcdoc = ''; } }