blob: f3a0fb257adf204431a2df4ade796c74c0643950 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
"use strict";
self.onmessage = async (message) => {
function reply(data) {
self.postMessage({data});
}
switch (message.data.command) {
case "fetch": {
const response = await fetch(message.data.url, {mode: 'cors', credentials: 'include'})
.then((resp) => resp.text());
reply(response);
break;
}
default:
}
};
|