Re: [css-houdini-drafts] [worklet] API of CSS.paintWorklet.addModule(url) produces network requests (#979)

IIUC, this requires to make the class definition copyable/transferable to send it from the page to the worklet context. I guess it's not so easy.

Instead, how about using blob URL like this? This is already available, and doesn't produce an actual network request.

```js
const kBlob = new Blob(["// your worklet code"], {type: 'text/javascript'});
const kBlobURL = URL.createObjectURL(kBlob);
CSS.paintWorklet.addModule(kBlobURL);
```

-- 
GitHub Notification of comment by nhiroki
Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/979#issuecomment-581190960 using your GitHub account

Received on Sunday, 2 February 2020 23:42:18 UTC