bean icon indicating copy to clipboard operation
bean copied to clipboard

Support running inside a Web Worker

Open ariofrio opened this issue 12 years ago • 4 comments

Support running from loadScript() inside a Web Worker (there is no window nor document there), in Chrome.

ariofrio avatar Mar 03 '12 22:03 ariofrio

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.

rvagg avatar Mar 04 '12 02:03 rvagg

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.

kkaefer avatar Nov 18 '13 11:11 kkaefer

It makes sense to include the checks. false could suffice if no in tests are needed:

var doc = typeof document !== 'undefined' && document

ryanve avatar Nov 18 '13 21:11 ryanve

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?

rvagg avatar Nov 19 '13 00:11 rvagg