2

I'm working on simple POC project that use service workers and web notifications. I'm wondering if there is an option to replace browser logo (e.g Google Chrome logo) with the custom one.

enter image description here

I've looked into Service Workers API documentation and I found that I can pass image, icon and badge properties in the options as second parameter of the ​ServiceWorkerRegistration.showNotification(title, [options]); function.

  • icon: a USVString containing the URL of an image to be used as an icon by the notification.
  • image: a USVString containing the URL of an image to be displayed in the notification.
  • badge: a USVString containing the URL of an image to represent the notification when there is not enough space to display the notification itself such as for example, the Android Notification Bar. On Android devices, the badge should accommodate devices up to 4x resolution, about 96 by 96 px, and the image will be automatically masked.

None of them actually will replace browser logo. Is there any workaround to achieve this or it's impossible to replace browser logo in web notification.

TariqN
  • 668
  • 2
  • 9
  • 27
  • I would think not for security reasons. – Scott Marcus Apr 09 '20 at 20:47
  • 2
    No, you can't replace / remove the Chrome logo, because it indicates to the user which app is displaying the notification. The only thing that you can try (not tested) is to install your website as a PWA... in that case it would make sense for Chrome to show your app icon. – collimarco Apr 09 '20 at 21:11

0 Answers0