How to pass data from localstorage serviceworker?

var CACHE_NAME = 'my-site-cache-v1';
var urlsToCache = [
 console.log('Opened cache', urlsToCache);
 return cache.addAll(urlsToCache);

It looks like sw.js
I need to make in the body of the document urlsToCache variable contains addresses or receive the addresses from localStorage. How to do it ?
localStorage is not available in sw.js.
March 19th 20 at 08:32
1 answer
March 19th 20 at 08:34
Need to add custom event in which you for example can pluralise these same data and put them wherever you want.

Find more questions by tags JavaScript