Merge branch 'develop' into pr/ThatOneCalculator/8764

This commit is contained in:
tamaina 2022-09-20 02:35:06 +00:00
commit 338a076c5f
1318 changed files with 41983 additions and 46058 deletions

View file

@ -24,6 +24,16 @@ self.addEventListener('activate', ev => {
});
self.addEventListener('fetch', ev => {
let isHTMLRequest = false;
if (ev.request.headers.get('sec-fetch-dest') === 'document') {
isHTMLRequest = true;
} else if (ev.request.headers.get('accept')?.includes('/html')) {
isHTMLRequest = true;
} else if (ev.request.url.endsWith('/')) {
isHTMLRequest = true;
}
if (!isHTMLRequest) return;
ev.respondWith(
fetch(ev.request)
.catch(() => new Response(`Offline. Service Worker @${_VERSION_}`, { status: 200 }))

View file

@ -10,7 +10,7 @@ export type SwMessage = {
[x: string]: any;
};
// Defined also @/services/push-notification.ts#L7-L14
// Defined also @/core/push-notification.ts#L7-L14
type pushNotificationDataSourceMap = {
notification: Misskey.entities.Notification;
unreadMessagingMessage: Misskey.entities.MessagingMessage;