const worker = workerize(` export function drawImage(canvas,image){ return canvas.getContext("2d").drawImage(image, 0, 0)} `)(canvas, image) worker.drawImage(document.querySelector('canvas'). transferControlToOffscreen(),img)
it will throw
DOMException: Failed to execute 'postMessage' on 'Worker': An OffscreenCanvas could not be cloned because it was not transferred.
https://developer.mozilla.org/en-US/docs/Web/API/Transferable
@developit
i am also interested in this, because i'd like to workerize the webp-hero polyfill, which will best be implemented with a transferable OffscreenCanvas
OffscreenCanvas
Activity
janryWang commentedon Mar 27, 2019
@developit
chase-moskal commentedon Apr 29, 2019
i am also interested in this, because i'd like to workerize the webp-hero polyfill, which will best be implemented with a transferable
OffscreenCanvas