Multiple html5 Notification tags open at the same time resulting in duplicate notifications

  if (window.Notification) {
    if (Notification.permission === "granted") {
      const _notification = new Notification(json.title, json.option);
      _notification.onclick = function (e) {
        window.focus();
        _notification.close();
      }
    }else {
      Notification.requestPermission();
    }
  }

as mentioned above, my test found that if visitors visit the website and open multiple tab pages with the browser, pointing to different pages of the site, if Notification is pushed at this time, notification bubbles will appear repeatedly in the lower right corner of the computer desktop.
is there any solution to this problem?

May.26,2022

configuration item: tag: add a tag to the message. If the tag is the same when the new message appears, the old tag will be replaced instead of repeating
reference: https://yangbo5207.github.io/...

.
Menu