Hello. Yesterday I found a library on js, called upup , with the help of it you can display the site pages when the internet connection is gone.

As stated in the official documentation , all that is needed is to connect the library and output what we need. (This can be a page, or just an inscription).

How I did:

Before closing </body> inserted <script src="upup.min.js"></script> , the documentation says that the library is in the root of our site and not in the child folder.

Then I wrote a simple phrase that should be shown when a connection is lost:

 <script> UpUp.start({ content: 'Cannot reach site. Please check your internet connection.' }); </script> 

In fact, it should have worked, but it does not work. Still shows a browser error, although this works on the site upup , you can go to the site and disable the Internet.

  • service worker is registered, checked? - dakiesse
  • @dakiesse, just read more about this, and as far as I understand, you need to have an SSL certificate in order to use this, right? - Abmin
  • one
    that's right, and free ssl can be obtained on cloudflare.com , but the article habrahabr.ru/post/239507 - dakiesse

1 answer 1

For the service worker to work, the site needs an SSL certificate.