first-commit
ci / Validate workspace (push) Has been cancelled
landing-page-ci / Validate landing page (push) Has been cancelled
landing-page-deploy / Deploy landing page (push) Has been cancelled
github-metrics / Generate repository metrics SVG (push) Has been cancelled
refresh-contributors-wall / Refresh contributors wall cache bust (push) Waiting to run

This commit is contained in:
Zakaria
2026-05-04 14:58:14 -04:00
commit a46764fb1b
1210 changed files with 233231 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
// Browser service workers must be served as JavaScript files. This tiny
// runtime exists only to display task-completion notifications and focus
// the existing Open Design tab when the user clicks one.
self.addEventListener('notificationclick', (event) => {
event.notification.close();
const data = event.notification.data || {};
const targetUrl = typeof data.url === 'string' ? data.url : self.location.origin;
event.waitUntil((async () => {
const windows = await self.clients.matchAll({
type: 'window',
includeUncontrolled: true,
});
const sameOrigin = windows.find((client) => {
try {
return new URL(client.url).origin === self.location.origin;
} catch {
return false;
}
});
if (sameOrigin) {
if ('navigate' in sameOrigin) {
try {
await sameOrigin.navigate(targetUrl);
} catch {
/* focus the existing tab below */
}
}
return sameOrigin.focus();
}
if (self.clients.openWindow) {
return self.clients.openWindow(targetUrl);
}
return undefined;
})());
});