forked from Kieran/void.cat
Show CF challenge inline
This commit is contained in:
parent
f47ca6cb5e
commit
d4b7e797e9
@ -28,7 +28,7 @@
|
||||
background-color: rgba(0,0,0,0.8);
|
||||
}
|
||||
|
||||
.upload .iframe-challenge > iframe {
|
||||
.upload .iframe-challenge > div {
|
||||
margin-left: 25vw;
|
||||
width: 50vw;
|
||||
height: 100vh;
|
||||
|
@ -166,6 +166,12 @@ export function FileUpload(props) {
|
||||
}
|
||||
}
|
||||
|
||||
function getChallengeElement() {
|
||||
let elm = document.createElement("div");
|
||||
elm.innerHTML = challenge;
|
||||
return <div dangerouslySetInnerHTML={{ __html: elm.innerHTML }}/>;
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
console.log(props.file);
|
||||
doXHRUpload().catch(console.error);
|
||||
@ -186,7 +192,7 @@ export function FileUpload(props) {
|
||||
</div>
|
||||
{uState === UploadState.Challenge ?
|
||||
<div className="iframe-challenge" onClick={() => window.location.reload()}>
|
||||
<iframe src={`data:text/html;charset=utf-8,${encodeURIComponent(challenge)}`}/>
|
||||
{getChallengeElement()}
|
||||
</div>
|
||||
: null}
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user