mirror of
https://github.com/andrei0x309/clear-wallet.git
synced 2024-11-26 11:41:33 +00:00
20 lines
534 B
HTML
20 lines
534 B
HTML
|
<!DOCTYPE html>
|
||
|
<html>
|
||
|
<head>
|
||
|
</head>
|
||
|
<body>
|
||
|
<h1>Eval Sandbox</h1>
|
||
|
<script>
|
||
|
// console.log('sandbox loaded');
|
||
|
window.addEventListener('message', function (event) {
|
||
|
// console.log('message received', event);
|
||
|
const data = event.data;
|
||
|
const execFunc = new Function(
|
||
|
'return ' + data.code
|
||
|
);
|
||
|
const result = execFunc();
|
||
|
event.source.postMessage({ result }, event.origin);
|
||
|
});
|
||
|
</script>
|
||
|
</body>
|
||
|
</html>
|