Is there any easy way to feature detect Web Push API in browsers (Desktop and mobile)
Some browser versions support only the service worker but not the Push API.
It's recommended that you try to detect the Push API itself.
If you need to check the browser support in a synchronous way (i.e. without waiting for Promise), you can use this (copied from the Pushpad SDK):
function isPushApiSupported() {
return 'PushManager' in window;
}