websandbox:HTML5沙盒iframe中用于Runnung javascript的沙盒库

时间:2021-05-10 15:05:49
【文件属性】:
文件名称:websandbox:HTML5沙盒iframe中用于Runnung javascript的沙盒库
文件大小:61KB
文件格式:ZIP
更新时间:2021-05-10 15:05:49
JavaScript 沙盒 Websandbox库提供了一种在HTML5沙箱中执行不安全js代码的方法-具有沙箱属性的iframe。 可以托管用户提供的窗口小部件和类似情况。 工作示例: : 。 使用简单(请参阅以获取更多信息): import Sandbox from 'websandbox' ; Sandbox . create ( { } ) . promise . then ( function ( sandbox ) { sandbox . run ( 'console.log("Hello from sandbox!")' ) ; } ) ; 函数运行(将在沙箱中进行字符串化和调用) 函数应具有“名称”属性才能运行。 import Sandbox from 'websandbox' ; var localApi = { testApiFn : f
【文件预览】:
websandbox-master
----.eslintrc(303B)
----webpack-examples.config.js(1KB)
----yarn.lock(160KB)
----webpack.config.js(809B)
----.babelrc(69B)
----lib()
--------frame.js(2KB)
--------websandbox.js(5KB)
--------connection.js(6KB)
----examples()
--------style()
--------index.html(232B)
--------simple()
--------importScript()
----.travis.yml(396B)
----test()
--------connection.test.js(4KB)
--------sandbox.test.js(6KB)
----README.md(3KB)
----.gitignore(37B)
----karma.conf.js(1KB)
----package.json(2KB)

网友评论

相关文章