wesal/frontend/web/index.html

88 lines
2.5 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<!--
If you are serving your web app in a path other than the root, change the
href value below to reflect the base path you are serving from.
The path provided below has to start and end with a slash "/" in order for
it to work correctly.
For more details:
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
This is a placeholder for base href that will be replaced by the value of
the `--base-href` argument provided to `flutter build`.
-->
<base href="$FLUTTER_BASE_HREF">
<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<meta name="description" content="Wesal - Connections Made Easier">
<!-- iOS meta tags & icons -->
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="Wesal">
<link rel="apple-touch-icon" href="icons/ios/180.png">
<!-- Favicon -->
<link rel="icon" type="image/png" href="icons/ios/32.png" />
<title>Wesal</title>
<link rel="manifest" href="manifest.json">
<style>
body {
overscroll-behavior-x: none;
-webkit-overflow-scrolling: touch;
}
/* Prevent pull-to-refresh and back gesture */
html,
body {
overflow-x: hidden;
position: fixed;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<script src="flutter_bootstrap.js" async></script>
<!-- Firebase Messaging Service Worker -->
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', function () {
navigator.serviceWorker.register('/firebase-messaging-sw.js')
.then(function (registration) {
console.log('Firebase Messaging Service Worker registered successfully:', registration);
})
.catch(function (error) {
console.log('Firebase Messaging Service Worker registration failed:', error);
});
});
}
// Prevent iOS Safari back gesture
window.addEventListener('touchstart', function (e) {
if (e.touches.length > 1) return;
const touch = e.touches[0];
if (touch.clientX < 20) { // Left edge
e.preventDefault();
}
}, { passive: false });
// Override browser back
window.addEventListener('popstate', function (e) {
e.preventDefault();
// Send message to Flutter
window.dispatchEvent(new CustomEvent('browser-back'));
});
</script>
</body>
</html>