aboutsummaryrefslogtreecommitdiffstats
path: root/core/src/views/UnsupportedBrowser.vue
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/views/UnsupportedBrowser.vue')
-rw-r--r--core/src/views/UnsupportedBrowser.vue68
1 files changed, 26 insertions, 42 deletions
diff --git a/core/src/views/UnsupportedBrowser.vue b/core/src/views/UnsupportedBrowser.vue
index f9125fa9958..408cccf61e9 100644
--- a/core/src/views/UnsupportedBrowser.vue
+++ b/core/src/views/UnsupportedBrowser.vue
@@ -1,24 +1,7 @@
- <!--
- - @copyright 2022 John Molakvoæ <skjnldsv@protonmail.com>
- -
- - @author John Molakvoæ <skjnldsv@protonmail.com>
- -
- - @license GNU AGPL version 3 or any later version
- -
- - This program is free software: you can redistribute it and/or modify
- - it under the terms of the GNU Affero General Public License as
- - published by the Free Software Foundation, either version 3 of the
- - License, or (at your option) any later version.
- -
- - This program is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- - GNU Affero General Public License for more details.
- -
- - You should have received a copy of the GNU Affero General Public License
- - along with this program. If not, see <http://www.gnu.org/licenses/>.
- -
- -->
+<!--
+ - SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
+ - SPDX-License-Identifier: AGPL-3.0-or-later
+-->
<template>
<div class="content-unsupported-browser guest-box">
<NcEmptyContent>
@@ -48,10 +31,13 @@
</template>
<script>
-import { generateUrl } from '@nextcloud/router'
+// eslint-disable-next-line n/no-extraneous-import
+import { agents } from 'caniuse-lite/dist/unpacker/agents.js'
+import { generateUrl, getRootUrl } from '@nextcloud/router'
import { translate as t, translatePlural as n } from '@nextcloud/l10n'
-import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
-import NcEmptyContent from '@nextcloud/vue/dist/Components/NcEmptyContent.js'
+
+import NcButton from '@nextcloud/vue/components/NcButton'
+import NcEmptyContent from '@nextcloud/vue/components/NcEmptyContent'
import Web from 'vue-material-design-icons/Web.vue'
import { browserStorageKey } from '../utils/RedirectUnsupportedBrowsers.js'
@@ -69,12 +55,6 @@ export default {
NcEmptyContent,
},
- data() {
- return {
- agents: {},
- }
- },
-
computed: {
isMobile() {
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
@@ -109,12 +89,12 @@ export default {
})
return Object.keys(list).map(id => {
- if (!this.agents[id]?.browser) {
+ if (!agents[id]?.browser) {
return null
}
const version = list[id]
- const name = this.agents[id]?.browser
+ const name = agents[id]?.browser
return this.t('core', '{name} version {version} and above', {
name, version,
})
@@ -122,13 +102,6 @@ export default {
},
},
- async beforeMount() {
- // Dynamic load big list of user agents
- // eslint-disable-next-line n/no-extraneous-import
- const { agents } = await import('caniuse-lite')
- this.agents = agents
- },
-
methods: {
t,
n,
@@ -140,12 +113,22 @@ export default {
// Redirect if there is the data
const urlParams = new URLSearchParams(window.location.search)
if (urlParams.has('redirect_url')) {
- const redirectPath = Buffer.from(urlParams.get('redirect_url'), 'base64').toString() || '/'
+ let redirectPath = Buffer.from(urlParams.get('redirect_url'), 'base64').toString() || '/'
+
+ // remove index.php and double slashes
+ redirectPath = redirectPath
+ .replace('index.php', '')
+ .replace(getRootUrl(), '')
+ .replace(/\/\//g, '/')
+
+ // if we have a valid redirect url, use it
if (redirectPath.startsWith('/')) {
window.location = generateUrl(redirectPath)
return
}
}
+
+ // else redirect to root
window.location = generateUrl('/')
},
@@ -181,7 +164,8 @@ $spacing: 30px;
.empty-content {
margin: 0;
- &::v-deep .empty-content__icon {
+
+ :deep(.empty-content__icon) {
opacity: 1;
}
}
@@ -195,7 +179,7 @@ $spacing: 30px;
margin-top: 2 * $spacing;
margin-bottom: $spacing;
li {
- text-align: left;
+ text-align: start;
}
}
}