提交 0e3c50a2 编写于 作者: J Johannes Rieken

workaround dev tools issue, #75061

上级 5018fdf9
......@@ -60,6 +60,12 @@ self.addEventListener('fetch', async (event: FetchEvent) => {
});
async function respondWithDefault(event: FetchEvent): Promise<Response> {
if (event.request.cache === 'only-if-cached' && event.request.mode !== 'same-origin') {
// https://bugs.chromium.org/p/chromium/issues/detail?id=823392
// https://stackoverflow.com/questions/48463483/what-causes-a-failed-to-execute-fetch-on-serviceworkerglobalscope-only-if#49719964
// https://developer.mozilla.org/en-US/docs/Web/API/Request/cache
return new Response(undefined, { status: 504, statusText: 'Gateway Timeout (dev tools: https://bugs.chromium.org/p/chromium/issues/detail?id=823392)' });
}
return await event.preloadResponse || await fetch(event.request);
}
......
......@@ -10,7 +10,7 @@
// statement.
// trigger service worker updates
const _tag = '91e182d6-d06b-40ff-a517-32df368117f8';
const _tag = 'c6f6120b-1407-4dd2-84cf-0fe0ef955140';
// loader world
const baseUrl = '../../../../../';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册