Closed otakustay closed 6 years ago
I believe there’s only one option like that, disableWorkerMessageHandler
. Manual is used internally already. Do workers actually work? Can we always turn them off?
I strongly recommend refractor to disable Prism's web worker mode by default, the web worker mode only provides Prism's core functionality but not a virtual dom based solution
Could you do a PR then?
PrismJS itself contains a bunch of predefined behaviors, for example it automatically listen the
message
event when in a web worker, these behaviors can be disabled via global flags such asself.disableWorkerMessageHandler = true;
With refractor it initialize a PrismJS instance when module is imported, we don't have a good chance to set these flags when use es modules, so some lazy initialization would be very helpful: