clear-wallet/eval-sandbox.html

36 lines
1.2 KiB
HTML

<!DOCTYPE html>
<html lang="en" style="width:400px;height:500px">
<head>
<meta charset="utf-8" />
<title>Clear Wallet SandBox</title>
<base href="/" />
<meta name="color-scheme" content="light dark" />
<meta
name="viewport"
content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<!-- add to homescreen for ios -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-title" content="Clear Wallet" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
</head>
<body>
<h1>Eval Sandbox</h1>
<script>
console.info('sandbox loaded');
window.addEventListener('message', function (event) {
const data = event.data;
const execFunc = new Function(
'return ' + data.code
);
const result = execFunc();
event.source.postMessage({ result }, event.origin);
});
</script>
</body>
</html>