Browse Source

fix: handle Notification requireInteraction option (#36503)

Co-authored-by: Jeremy Spiegel <[email protected]>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Spiegel <[email protected]>
trop[bot] 2 years ago
parent
commit
c9590a7c3a
1 changed files with 3 additions and 0 deletions
  1. 3 0
      shell/browser/notifications/platform_notification_service.cc

+ 3 - 0
shell/browser/notifications/platform_notification_service.cc

@@ -35,6 +35,9 @@ void OnWebNotificationAllowed(base::WeakPtr<Notification> notification,
     options.icon = icon;
     options.silent = audio_muted ? true : data.silent;
     options.has_reply = false;
+    if (data.require_interaction)
+      options.timeout_type = u"never";
+
     notification->Show(options);
   } else {
     notification->Destroy();