Service Worker: Fix pathname issues (#3642)
This commit is contained in:
parent
cde0f8c5f8
commit
8835e215f5
@ -56,17 +56,17 @@ self.addEventListener('fetch', (e: FetchEvent) => {
|
|||||||
const { pathname, protocol } = new URL(url);
|
const { pathname, protocol } = new URL(url);
|
||||||
const { pathname: scopePathname } = new URL(scope);
|
const { pathname: scopePathname } = new URL(scope);
|
||||||
|
|
||||||
if (pathname.startsWith('/progressive/')) {
|
if (pathname.includes('/progressive/')) {
|
||||||
e.respondWith(respondForProgressive(e));
|
e.respondWith(respondForProgressive(e));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pathname.startsWith('/download/')) {
|
if (pathname.includes('/download/')) {
|
||||||
e.respondWith(respondForDownload(e));
|
e.respondWith(respondForDownload(e));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pathname.startsWith('/share/')) {
|
if (pathname.includes('/share/')) {
|
||||||
e.respondWith(respondForShare(e));
|
e.respondWith(respondForShare(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user