diff --git a/app.js b/app.js
index 35cc1e9..a65d7bc 100644
--- a/app.js
+++ b/app.js
@@ -56,6 +56,17 @@ function serviceSearchText(service) {
].join(' ');
}
+function isMobileDevice() {
+ return /Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
+}
+
+function getMobileUrl(service) {
+ if (service.id === 'drive') {
+ return 'https://drive.mischlabs.de/index.php/login/flow';
+ }
+ return service.mobileUrl;
+}
+
function createServiceCard(service) {
const category = categoryById.get(service.category);
const card = document.createElement('a');
@@ -81,22 +92,28 @@ function createServiceCard(service) {
${service.domain}
`;
- if (service.mobileUrl) {
+ const mobileUrl = getMobileUrl(service);
+ if (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);
+ if (!isMobileDevice()) return;
+
+ e.preventDefault();
+
+ if (/^https?:\/\//i.test(mobileUrl)) {
+ window.location.href = mobileUrl;
+ return;
}
+
+ const start = Date.now();
+ // Try to open the native mobile app through its registered URL scheme.
+ window.location.href = mobileUrl;
+
+ // Web fallback if the app is not installed or the scheme is not handled.
+ setTimeout(() => {
+ if (Date.now() - start < 1500) {
+ window.open(service.url, '_blank');
+ }
+ }, 800);
});
}
diff --git a/index.html b/index.html
index 99aa891..fb5b888 100644
--- a/index.html
+++ b/index.html
@@ -117,6 +117,6 @@
-
+