Skip to content

fix: Limit web workers used by ALTCHA to prevent Firefox (and maybe others?) from crashing

stephen requested to merge limit-workers-to-prevent-crashing into main

As per #139 (closed), there's an issue currently present on the donation form which is crashing browsers in the wild. The current suspicion is that it has to do with the number of web workers the ALTCHA plugin is leveraging (which always uses the maximum value of what's available).

This MR sets that number to Math.max(navigator.hardwareConcurrency / 2, 1) in an attempt to see if "fewer than all 16" will prevent the issue. Computers with only one core to spare for web workers will use it as normal, while other users will not have their CPU usage slammed so harshly.

Merge request reports