Notification Permission Request During Page Load

Google Lighthouse converts a relevant situation into a warning like the one below and sends it to you:

Notification Permission Request

To do this, Google Lighthouse checks all Javascript codes processed during page load. This way, if a code has a call like notification.requestPermission(), it is reported that the notification permission already exists. In this case, the audit is completed without a detailed observation.

In such a case, Lighthouse, which cannot see a new notification permission request, may fail to audit. So before starting an audit, be sure to reset the previously given permissions

Lighthouse provides you with the requests for notification permissions line by line with the URL.

So, how should the notification permissions request be submitted?

There should not be a notification.requestPermission() among the code running during the page load. For a better UX,

  1. Request permission with a specific notification view.
  2. In addition, the request for permission should be shaped by the user’s choice of notification type.

Test Your Website Issues

You can quickly analyze your site