bean
bean copied to clipboard
Support running inside a Web Worker
Support running from loadScript() inside a Web Worker (there is no window nor document there), in Chrome.
Interesting use case. I'm wondering how you're using Bean in a WebWorker? Are you listening to browser events or using it for pubsub? If the aim of this PR is to add WW support perhaps some tests for that would be neat if you can manage it.
I'd like to extend this request to node.js; bean.js assumes some global objects like window
, document
or navigator
which do not exist in node land.
It makes sense to include the checks. false
could suffice if no in
tests are needed:
var doc = typeof document !== 'undefined' && document
I'd like to see some tests for some of this, anyone got time and ideas for testing in webworkers and/or testing in node?