@icreate/sandbox
v0.0.1-beta.2
Published
window sandbox
Downloads
4
Maintainers
Keywords
Readme
Usage
npm i @icreate/sandbox
Features
- SandBox:window沙箱
Importing library
You can import the generated bundle to use the whole library generated by this starter:
import SandBox from '@icreate/sanbox'
Usage
import Sandbox from '@icreate/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();