So that the notification after the reboot is not repeated, if the message was seen by the person and it is the same, but if the message has changed, did the person display it?

<script> function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function sendNotification(title, options) { // Проверим, поддерживает ли браузер HTML5 Notifications if (!("Notification" in window)) { alert('Ваш браузер не поддерживает HTML Notifications, его необходимо обновить.'); } // Проверим, есть ли права на отправку уведомлений else if (Notification.permission === "granted") { // Если права есть, отправим уведомление var notification = new Notification(title, options); function clickFunc() {window.location.href = 'http://aviaciya.com/specpredlozheniya_aviakompanij/';} notification.onclick = clickFunc; } // Если прав нет, пытаемся их получить else if (Notification.permission !== 'denied') { Notification.requestPermission(function (permission) { // Если права успешно получены, отправляем уведомление if (permission === "granted") { var notification = new Notification(title, options); } else { alert('Вы запретили показывать уведомления'); // Юзер отклонил наш запрос на показ уведомлений } }); } else { // Пользователь ранее отклонил наш запрос на показ уведомлений // В этом месте мы можем, но не будем его беспокоить. Уважайте решения своих пользователей. }}</script> <script type="text/javascript" async> sendNotification('Зимние скидки на авиабилеты!', { body: 'Распродажа, сезонные скидки', icon: 'http://avia-avia.ru/image/samolet_p.png', dir: 'auto' });</script> 
  • and where is called: createCookie and the value of cookies is checked? - Grundy
  • @Grundy, I do not know ((, help me finish pliz - Arcadiy
  • where did you get this code from? - Grundy
  • From the Internet, someone asked such a question but did not get any answers on a foreign site - Arcadiy

0