Is It Possible to Sandbox JavaScript Running In the Browser?

前端 未结 15 684
北海茫月
北海茫月 2020-11-22 13:58

I\'m wondering if it\'s possible to sandbox JavaScript running in the browser to prevent access to features that are normally available to JavaScript code running in an HTML

15条回答
  •  花落未央
    2020-11-22 14:18

    I think that js.js is worth mentioning here. It's a JavaScript interpreter written in JavaScript.

    It's about 200 times slower than native JS, but its nature makes it a perfect sandbox environment. Another drawback is its size – almost 600 kb, which may be acceptable for desktops in some cases, but not for mobile devices.

提交回复
热议问题