How to avoid the Unresponsive Script popup in Firefox with long running Javascript?

后端 未结 5 895
心在旅途
心在旅途 2021-01-02 05:18

I want to benchmark some Javascript code in the browser, but it may trigger Firefox\'s \"Warning: Unresponsive script\" popup. This allows the user to click \"Stop script\"

5条回答
  •  余生分开走
    2021-01-02 05:39

    You can use the script from this question to break processing long lists into smaller chunks:

    How can I give control back (briefly) to the browser during intensive JavaScript processing?

提交回复
热议问题