Service worker is not supported in chrome (69.0.3497.81)

Viewed 9438

I am start working with PWA (Progressive web app). When I try to check service worker is supported or not in chrome browser.It always return false. Below code I used for the checking.

Note: I am using chrome Version 69.0.3497.81 (Official Build) (64-bit).

app.js

if ('serviceWorker' in navigator) {
    navigator.serviceWorker.register('/sw.js').then(function() {
        console.log('service worker registered');
    });
}

Need help to register service worker in chrome.

1 Answers

This problem is cause due to I am running my application on http://192.168.1.11:8080 but when I switch domain to http://localhost:8080/. it's working fine.

Chrome requires service workers to be served over https, but allows an exception for localhost for development.

Related