samedi 28 février 2015

Window, DOM and jQuery mocks for Web Worker

I am using a third party library that in turn uses mxGraph, jQuery and ext-js. This library has two modules,



  1. UI (This is where the above listed libraries are used)

  2. A processing engine (this is free of above libraries)


I want to run the processing engine on a web worker via the APIs exposed by the library. The issue is that library code is not segregated into separate files. So I tried importing all the files using importScriptin the web worker but naturally it fails since the web worker does not have access to document, window, jquery etc.


Are you guys aware of mock APIs for window, document etc which I can use in my web worker so that my importScript call can pass successfully and then I can run the process safely since the code that gets executed here does not use window or document.


Thanks,


Aucun commentaire:

Enregistrer un commentaire