-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBrowserMissingModal.vue
More file actions
91 lines (83 loc) · 2.61 KB
/
BrowserMissingModal.vue
File metadata and controls
91 lines (83 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<script setup lang="ts">
/**
* Modale affichée au lancement de l'app desktop si aucun navigateur supporté
* (Chrome ou Edge) n'est installé. Vinted (publication + synchro) en a besoin :
* le worker local pilote ce navigateur via nodriver.
*
* Côté web (sans Tauri), `noBrowser` reste à `false` → la modale ne s'affiche jamais.
*/
const { isDesktopApp } = useDesktopRuntime()
const { state, checked, check, openExternal } = useBrowserAvailability()
const open = ref(false)
async function refresh() {
await check(true)
open.value = Boolean(state.value?.noBrowser)
}
onMounted(async () => {
if (!isDesktopApp.value) {
return
}
await check()
open.value = Boolean(state.value?.noBrowser)
})
watch(
() => state.value?.noBrowser,
(v) => {
if (checked.value) {
open.value = Boolean(v)
}
}
)
async function installChrome() {
await openExternal(state.value?.chromeInstallUrl || 'https://www.google.com/intl/fr_fr/chrome/')
}
</script>
<template>
<UModal
v-model:open="open"
:dismissible="false"
:close="false"
title="Google Chrome est requis"
:ui="{ content: 'max-w-lg' }"
>
<template #body>
<div class="space-y-4">
<p class="text-sm text-default">
GoupixDex pilote <strong>Vinted</strong> (publication d'annonces et synchronisation
de votre dressing) à travers <strong>Google Chrome</strong> installé sur votre
machine. Microsoft Edge est utilisé comme solution de repli s'il est présent.
</p>
<p class="text-sm text-muted">
Aucun de ces deux navigateurs n'a été détecté. Installez Chrome (gratuit, ~2 min)
puis cliquez sur « J'ai installé Chrome ».
</p>
<div class="rounded-md border border-default bg-elevated/50 p-3 text-xs text-muted space-y-1">
<p>
<span class="font-medium text-highlighted">Pourquoi ?</span>
Vinted bloque les requêtes serveur classiques (Cloudflare). GoupixDex contourne
cela en automatisant un vrai navigateur installé chez vous, depuis votre IP
résidentielle.
</p>
</div>
</div>
</template>
<template #footer>
<div class="flex w-full justify-end gap-2">
<UButton
color="neutral"
variant="ghost"
icon="i-lucide-refresh-cw"
@click="refresh"
>
J'ai installé Chrome
</UButton>
<UButton
icon="i-lucide-download"
@click="installChrome"
>
Télécharger Chrome
</UButton>
</div>
</template>
</UModal>
</template>