Baseline 2023 *
Newly available
ã¡ã¢: ãã®æ©è½ã¯ãµã¼ãã¹ã¯ã¼ã«ã¼å ã§ã®ã¿å©ç¨å¯è½ã§ãã
NotificationEvent
ã¯éç¥ APIã®ã¤ã³ã¿ã¼ãã§ã¤ã¹ã§ããµã¼ãã¹ã¯ã¼ã«ã¼ (ServiceWorker
) ã® ServiceWorkerGlobalScope
ã§é
ä¿¡ãããéç¥ã¤ãã³ãã表ãã¾ãã
ãã®ã¤ã³ã¿ã¼ãã§ã¤ã¹ã¯ ExtendableEvent
ã¤ã³ã¿ã¼ãã§ã¤ã¹ãç¶æ¿ãã¦ãã¾ãã
ã¡ã¢: ServiceWorkerGlobalScope
ãªãã¸ã§ã¯ãã§çºè¡ãããæç¶çãªéç¥ã¤ãã³ãã®ã¿ããNotificationEvent
ã¤ã³ã¿ã¼ãã§ã¤ã¹ãå®è£
ãã¾ããNotification
ãªãã¸ã§ã¯ãã§çºè¡ãããéæç¶çãªéç¥ã¤ãã³ãã¯ãEvent
ã¤ã³ã¿ã¼ãã§ã¤ã¹ãå®è£
ãã¾ãã
NotificationEvent()
æ°ãã NotificationEvent
ãªãã¸ã§ã¯ãã使ãã¾ãã
親ã¤ã³ã¿ã¼ãã§ã¤ã¹ã§ãã ExtendableEvent
ããç¶æ¿ããããããã£ãããã¾ãã
NotificationEvent.notification
èªåå°ç¨
ã¤ãã³ããçºçãããããã«ã¯ãªãã¯ãããéç¥ã表ã Notification
ãªãã¸ã§ã¯ããè¿ãã¾ãã
NotificationEvent.action
èªåå°ç¨
ã¦ã¼ã¶ã¼ãã¯ãªãã¯ããéç¥ãã¿ã³ã®æåå ID ãè¿ãã¾ããã¦ã¼ã¶ã¼ãã¢ã¯ã·ã§ã³ãã¿ã³ä»¥å¤ã®å ´æã§éç¥ãã¯ãªãã¯ããå ´åãã¾ãã¯éç¥ã«ãã¿ã³ããªãå ´åããã®å¤ã¯ç©ºã®æååãè¿ãã¾ãã
親ã¤ã³ã¿ã¼ãã§ã¤ã¹ã§ãã ExtendableEvent
ããç¶æ¿ããã¡ã½ãããããã¾ãã
self.addEventListener("notificationclick", (event) => {
console.log(`On notification click: ${event.notification.tag}`);
event.notification.close();
// ããã¯ãç¾å¨ã®ãã¼ã¸ãæ¢ã«éãã¦ãããã©ããã確èªãã
// ãããªãã°ãã©ã¼ã«ã¹ãã¾ã
event.waitUntil(
clients
.matchAll({
type: "window",
})
.then((clientList) => {
for (const client of clientList) {
if (client.url === "/" && "focus" in client) return client.focus();
}
if (clients.openWindow) return clients.openWindow("/");
}),
);
});
仿§æ¸
ã¡ã¢: ãã®ã¤ã³ã¿ã¼ãã§ã¤ã¹ã¯éç¥ API ã§å®ç¾©ããã¦ãã¾ãããServiceWorkerGlobalScope
ãéãã¦ã¢ã¯ã»ã¹ãã¾ãã
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4