mirror of
https://github.com/nextcloud/server.git
synced 2026-03-20 17:43:15 -04:00
Merge pull request #49694 from nextcloud/bugfix/fix-service-worker-scope
This commit is contained in:
commit
94fa2cf79f
3 changed files with 6 additions and 5 deletions
|
|
@ -2,7 +2,7 @@
|
|||
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
import { generateUrl, getRootUrl } from '@nextcloud/router'
|
||||
import logger from '../logger.ts'
|
||||
|
||||
export default () => {
|
||||
|
|
@ -11,7 +11,8 @@ export default () => {
|
|||
window.addEventListener('load', async () => {
|
||||
try {
|
||||
const url = generateUrl('/apps/files/preview-service-worker.js', {}, { noRewrite: true })
|
||||
const registration = await navigator.serviceWorker.register(url, { scope: '/' })
|
||||
const scope = getRootUrl()
|
||||
const registration = await navigator.serviceWorker.register(url, { scope })
|
||||
logger.debug('SW registered: ', { registration })
|
||||
} catch (error) {
|
||||
logger.error('SW registration failed: ', { error })
|
||||
|
|
|
|||
4
dist/files-init.js
vendored
4
dist/files-init.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files-init.js.map
vendored
2
dist/files-init.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue