Created
July 17, 2020 10:56
-
-
Save iliakan/5e2c082a2d237645ff09dc32fce51c0f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = class HtmlCodeRunner { | |
async run({ code, waitForResult, timeout }) { | |
const { port1, port2 } = new MessageChannel(); | |
// .querySelector('#previewWorkerManagerFrame') | |
this.elem.contentWindow.postMessage( | |
{ | |
command, | |
sandbox, | |
waitForResult, | |
timeout, | |
}, | |
'*', | |
[port2] | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment