- Issue created by @Anybody
- 🇩🇪Germany Anybody Porta Westfalica
We should have tests to ensure it works in both cases. Not yet sure how to do that... perhaps there are examples in core?
- 🇩🇪Germany Grevil
The thing is, we currently never use "drupalSettings.path", as during install, we set "/" as the default scope setting, and use that to initialize the service worker. "/" in the scope initialization means, that the worker can basically intercept any calls on the site see:
https://stackoverflow.com/questions/35780397/understanding-service-worke...
https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Usin...BUT, the scope is manually changeable! Meaning, that if our PWA is under "/mysite/mypwa", we set the scope to "/mysite/mypwa", but our site is multilingual, the service worker will not be able to intercept anything, as any url would look like this: "/en/mysite/mypwa".
I guess, we should definitely fix this for multilingual sites.
- 🇩🇪Germany Grevil
Since this is mainly an edge-case, (because most of the pwa's are the website itself). We keep this issue open, and maybe we need it in the future!
But basically, we would need a checkbox to "respect" multilingual prefixes (meaning it would prefix the scope with the current language prefix on initialization).