deckgo / starter-kit

The developer kit to create slides with DeckDeckGo
https://deckdeckgo.com
MIT License
47 stars 13 forks source link

If deployed in domain.com/subpath service worker isn't registered #22

Closed peterpeterparker closed 5 years ago

peterpeterparker commented 5 years ago

It seems that if the deck is deployed in domain.com/subpath then the service worker won't be registered, which is probably correct according the code:

<script>
        if ('serviceWorker' in navigator) {
            window.addEventListener('load', async () => {
                try {
                    await navigator.serviceWorker.register('/service-worker.js');
                } catch (e) {
                    console.warn('No service worker registered');
                }
            });
        }
    </script>

But is there a way to make the service worker also registered if subcontext? or should I just add a topic about this in the documentation?

capture d ecran 2018-12-08 a 08 44 07