feat: implement automatic smart mobile app launcher with custom schemes and web fallbacks
All checks were successful
Build & Push Docker Image to Gitea Registry / build-and-push (push) Successful in 13s

This commit is contained in:
Kroonk
2026-05-21 22:28:22 +02:00
parent e663534000
commit 0d4377aed2
7 changed files with 107 additions and 5 deletions

20
app.js
View File

@@ -80,6 +80,26 @@ function createServiceCard(service) {
</div>
<span class="card-domain">${service.domain}</span>
`;
if (service.mobileUrl) {
card.addEventListener('click', (e) => {
const isMobile = /Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
if (isMobile) {
e.preventDefault();
const start = Date.now();
// Versuch, die mobile App über ihr registriertes Custom URL-Schema zu öffnen
window.location.href = service.mobileUrl;
// Web-Fallback nach 800ms, falls die App nicht installiert ist
setTimeout(() => {
if (Date.now() - start < 1500) {
window.open(service.url, '_blank');
}
}, 800);
}
});
}
return card;
}