blob: fc048e288e903e6c558c5518d133f2c2ec96223e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
<!doctype html>
<script>
const baseLocation = window.location;
const workerUrl = new URL('create-blob-url-worker.js', baseLocation).href;
const worker = new Worker(workerUrl);
function fetch_in_worker(url) {
const resourceUrl = new URL(url, baseLocation).href;
return new Promise((resolve) => {
worker.onmessage = (event) => {
resolve(event.data);
};
worker.postMessage(resourceUrl);
});
}
</script>
|