Improve window open and close handling

Use pagehide event instead of beforeunload, seems to be more reliable
Add a timeout and info message when opening the window fails
This commit is contained in:
Maximilian Krög
2021-10-20 01:18:05 +02:00
parent 5149224354
commit 7bed63bf3f
3 changed files with 46 additions and 27 deletions

View File

@@ -13,10 +13,6 @@
</style>
</head>
<body>
<script type="text/javascript">
if ((window.performance.navigation && window.performance.navigation.type === 1) || window.performance.getEntriesByType('navigation').map((nav) => nav.type).includes('reload'))
window.close();
</script>
<div id="map" class="map" tabindex="0"></div>
</body>
</html>