I am using the below script to register service worker, and would like to Check if this service worker supports push? Just for testing purpose I am printing 'Print Service worker', but it is not getting printed to console. Kindly help me to trigger where I am getting wrong?
function register()
{
if ('serviceWorker' in navigator)
{
navigator.serviceWorker.register('service-worker.js', {scope: scope}).then(initialiseState);
}
else {
console.warn('Service workers aren\'t supported in this browser.');
}
}
function initialiseState()
{
navigator.serviceWorker.ready.then(function(serviceWorkerRegistration)
{ console.log('Print Service worker');});
}
Thanking in advance