forked from Mirrors/elk
Compare commits
2 commits
main
...
userquin/f
Author | SHA1 | Date | |
---|---|---|---|
|
75e2589e1e | ||
|
9b0a67e0af |
2 changed files with 12 additions and 0 deletions
|
@ -15,6 +15,14 @@ export default defineNuxtRouteMiddleware((to) => {
|
||||||
|
|
||||||
function handleAuth(to: RouteLocationNormalized) {
|
function handleAuth(to: RouteLocationNormalized) {
|
||||||
if (to.path === '/') {
|
if (to.path === '/') {
|
||||||
|
// handle PWA protocol handler
|
||||||
|
if (to.query['protocol-handler'] && to.query.target) {
|
||||||
|
const target = (to.query.target as string).replace(/^web\+ap:\/\//, 'https://')
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log(target)
|
||||||
|
return navigateTo('/home')
|
||||||
|
}
|
||||||
|
|
||||||
// Installed PWA shortcut to notifications
|
// Installed PWA shortcut to notifications
|
||||||
if (to.query['notifications-pwa-shortcut'] !== undefined) {
|
if (to.query['notifications-pwa-shortcut'] !== undefined) {
|
||||||
if (currentUser.value)
|
if (currentUser.value)
|
||||||
|
|
|
@ -124,6 +124,10 @@ export async function createI18n(): Promise<LocalizedWebManifest> {
|
||||||
edge_side_panel: {
|
edge_side_panel: {
|
||||||
preferred_width: 480,
|
preferred_width: 480,
|
||||||
},
|
},
|
||||||
|
protocol_handlers: [{
|
||||||
|
protocol: 'web+ap',
|
||||||
|
url: '/?protocol-handler=1&target=%s',
|
||||||
|
}],
|
||||||
}
|
}
|
||||||
|
|
||||||
if (env === 'release') {
|
if (env === 'release') {
|
||||||
|
|
Loading…
Reference in a new issue