简体   繁体   English

第三方限额memory javascript

[英]Limit an amount of memory for a third-party javascript

Is it possible to limit an amount of memory that can be allocated by a third-party javascript code?是否可以限制第三方javascript代码可以分配的memory的数量?

UPDATE: The ideal situation is to have a 'sandbox' where:更新:理想的情况是有一个“沙箱”,其中:

  • Some user adds a piece of javascript code.一些用户添加了一段 javascript 代码。
  • This piece of code is being executed.这段代码正在执行。
  • If it allocates more than 5 mb - user gets an exception如果它分配超过 5 mb - 用户得到一个异常

Thanks in advance.提前致谢。 :) :)

I think it is depends on browser internal implementation and handled by browser, The end user of browser is not allowed to configure it.我认为这取决于浏览器内部实现并由浏览器处理,不允许浏览器的最终用户配置它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM