Use Notification.requestPermission in different versions of the browser in accordance with its implementation

I have a problem when a function has its implementation changed in new browsers. I want to call a function accordingly in accordance with the implementation.

Notification.requestPermission().then(function (permission) {...})

This was called earlier, for example,

Notification.requestPermission(callback);

I called the original path, and therefore, in older browsers, it is interrupted because the promise does not return in their implementation.

+4
source share

Source: https://habr.com/ru/post/1693693/


All Articles