in reply to Re^2: Service Worker
in thread Service Worker

This sounds as if your Javascript is not loaded from the HTML page. This is not a Perl problem.

To go forward with this, can you please reduce your code to say 20 lines that reproduce the problem? Maybe then we can understand better where your problem lies.