Facebook currently launches notifications when opening chrome. How can I do the same thing, ie fire a notification as soon as the user opens the chrome?
Facebook currently launches notifications when opening chrome. How can I do the same thing, ie fire a notification as soon as the user opens the chrome?
Hello, there is an API for browsers to display notifications. These notifications are created via javascript. Below are examples of using the API.
if (("Notification" in window)) {
//Verifica se o navegador tem suporte à notificações
if (Notification.permission === "granted") {
//Verifica se a permissão foi concedida pelo usuário
Notification.requestPermission(function (permission) {
//Requisita permissão para o usuário
var notification = new Notification("Hi there!");
//Envia notificação
To delve into this subject, I left below some links of the documentation: