blob: c650a0b7471bf499a00c2afdbd596b9688284dd1 (
plain)
1
2
3
4
5
6
7
8
|
self.addEventListener("fetch", e => {
if (e.request.url.endsWith('green.svg')) {
e.respondWith(new Response(`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="50">
<rect fill="lime" width="100" height="50"/>
</svg>
`, { headers: { 'Content-Type': 'image/svg+xml' } }));
}
});
|