In different threads you have to enter the context
Merge pull request #178 from zznate/javascript_context_fix

In different threads you have to enter the context