我现在正忙着服务工作者.我试图让'fetch'事件返回自定义HTML,而不仅仅是纯文本,如下所示:
self.addEventListener('fetch', function(event) {
console.log("Caught a fetch!");
event.respondWith(new Response("I want to return HTML here"));
});
Run Code Online (Sandbox Code Playgroud)
这是否可以使用respondWith函数?