   attemptTransfer = navigator.userAgent.toLowerCase().indexOf('firefox/18') == -1
   # Running a slave P3D instance in the webworker
   @onmessage = (event) ->
-    parser = new P3D.Parser(event.data)
-    # Returning the data
-    msg = {}
-    msg[k] = parser[k] for k in webWorkerAttrs
-    transfers = ( parser[k].buffer for k in ['normals', 'vertices', 'indices'] )
-    if parser.chunks?
-      transfers.push chunk[k].buffer for k in ['normals', 'vertices', 'indices'] for chunk in parser.chunks
-    postMessage msg, if attemptTransfer then transfers else undefined
+    parser = new P3D.Worker event.data, ->
+      # Returning the data
+      msg = {}
+      msg[k] = parser[k] for k in workerReturnedKeys
+      transfers = ( parser[k].buffer for k in ['normals', 'vertices', 'indices'] )
+      postMessage msg, if attemptTransfer then transfers else undefined
+
+
 
 
 # P3D

  #  opts: (optional) a object containing properties for this parser
  #     background: (boolean) if true this parser will spawn a webworker and run outside the UI thread
  #  callback: the fn to run once the 3d geometry has been parsed
  constructor: (@src, @opts) ->
    args = arguments
    @opts = {background: true} if args.length < 3 or !( @opts? )
    @callback = args[args.length-1]

    # Determining the file name and the file type
    @filename = if typeof(@src) == "string" then @src.split("/").pop().replace("/", "") else @src.name
    @fileType = capitalize fileExt(@filename).toLowerCase()

    if @_fileTypeWhitelist.indexOf(@fileType) == -1

# -----------------------------------------------------

isWorker = (self.document == undefined)
workerReturnedKeys = ['normals', 'vertices', 'indices', 'nOfTriangles', 'blob']
if !isWorker
  webWorkerFn = arguments.callee
  # Getting a blob url reference to this script's closure
