Was poking around with serviceWorkers to cache some of the pages of my site (a rails app) so I was thinking of registering my serviceworker.js like so:
// Playing with serviceworker.js
if (navigator.serviceWorker) {
navigator.serviceWorker.register('/serviceworker.js', {
scope: '/'
});
}
But I realize that on production server (with https://) /serviceworker.js path will not be available.
So I was thinking how should I register serviceworker.js that's going to be fingerprinted and spit out via the assets pipeline?