blob: 8a9fa5ef36176bef543394732ea26fe3d786c7bd (
plain)
1
2
3
4
5
6
7
8
|
self.addEventListener('message', async (e) => {
if (e.data === 'fetch') {
// Send a request to non-existing URL but handled by SW.
const res = await fetch('./fenced_frame_dedicated_worker_test');
const data = res.ok ? await res.text() : res.statusText;
self.postMessage(data);
}
});
|