@ice/sandbox
icestark sandbox solution. icestark docs.
Installation
$ npm install @ice/sandbox --save
Usage
import Sandbox from '@ice/sandbox';
const sandbox = new Sandbox();
// execute scripts in sandbox
sandbox.execScriptInSandbox('window.a = 1;console.log(window.a);');
// clear side effects added by sandbox, such as addEventListener, setInterval
sandbox.clear();
Inspiration
@ice/sandbox
is inspired by tc39/proposal-realms, realms-shim and qiankun sandbox.
Contributors
Feel free to report any questions as an issue, we'd love to have your helping hand on icestark
.
If you're interested in icestark
, see CONTRIBUTING.md for more information to learn how to get started.