Support the web worker context in window.js
Merge pull request #4 from iwillig/master

Support the web worker context in window.js