-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathtest.html
41 lines (37 loc) · 1.07 KB
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Test</title>
</head>
<body>
<!-- <script src="dist/browser-module-sandbox.js"></script> -->
<script src="dist/browser-module-sandbox.min.js"></script>
<script>
var sandbox = Sandbox({
name: "sandbox",
// cdn: 'http://localhost:8080',
cdn: "https://wzrd.now.sh",
cacheOpts: {
inMemory: true
},
iframeStyle: "body, html { height: 100%; width: 100%; overflow: auto }",
iframeSandbox: [
"allow-forms",
"allow-popups",
"allow-scripts",
"allow-same-origin",
"allow-modals"
]
});
// var code = `
// "use strict";
// var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
// var _react = _interopRequireDefault(require("react"));
// console.log("react", _react.default);
// `;
// sandbox.bundle(code, {});
sandbox.bundle('console.log(require("nooop"))', {});
</script>
</body>
</html>