Write challenge to iframe

This commit is contained in:
Kieran 2022-02-17 09:49:40 +00:00
parent a3bf77d355
commit 6f539a4102
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
2 changed files with 4 additions and 4 deletions

View File

@ -28,7 +28,7 @@
background-color: rgba(0,0,0,0.8);
}
.upload .iframe-challenge > div {
.upload .iframe-challenge iframe {
margin-left: 10vw;
width: 80vw;
height: 100vh;

View File

@ -169,9 +169,9 @@ export function FileUpload(props) {
}
function getChallengeElement() {
let elm = document.createElement("div");
elm.innerHTML = challenge;
return <div dangerouslySetInnerHTML={{ __html: elm.innerHTML }}/>;
let elm = document.createElement("iframe");
elm.contentWindow.document.write(challenge);
return <div dangerouslySetInnerHTML={{ __html: elm.outerHTML }}/>;
}
useEffect(() => {