vakata / jstree

jquery tree plugin
http://jstree.com
MIT License
5.15k stars 1.38k forks source link

Fallback when WebWorkers are available but deactivated #2606

Closed Seb35 closed 2 years ago

Seb35 commented 2 years ago

Hi, in some cases WebWorkers are available but are deactivated, like when a browser extension prevents them from executing. It append to me with the browser extension uMatrix (similar to uBlock for advanced users), blocking by default WebWorkers.

In this case jstree is displaying "Loading..." and it never finishes (observed with jstree 3.3.10, but I guess it is also true on the last version 3.3.12).

It can be fixed by adding a function onerror next to onmessage calling the function rslt like in the catch block a few lines below. I will sumbit a Pull Request for it.

PS: I remarked this through the MediaWiki extension PageForms (creating forms on a MediaWiki wiki) and the type of field 'tree'. PS2: By the way thank you very much for this library!