diff --git a/src/index.html b/src/index.html index 5a54560c2dbbb25445d51effeaac030b0078e023..56ca0ada6d668162853889d3f81ef9949e3eee1d 100644 --- a/src/index.html +++ b/src/index.html @@ -22,5 +22,34 @@ <body> <dlcm-root></dlcm-root> <noscript>Please enable JavaScript to continue using this application.</noscript> +<script> + // alert("Utiliser navigateur décent") + var ua = window.navigator.userAgent; + + var browserUnnsuported; + var msie = ua.indexOf('MSIE '); + if (msie > -1) { + // IE 10 or older => return version number + browserUnnsuported = "Internet Explorer " + parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10); + } + + var trident = ua.indexOf('Trident/'); + if (trident > -1) { + // IE 11 => return version number + var rv = ua.indexOf('rv:'); + browserUnnsuported = "Internet Explorer " + parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10); + } + + var edge = ua.indexOf('Edge/'); + if (edge > -1) { + // Edge (IE 12+) => return version number + browserUnnsuported = "Edge " + parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10); + } + + if (browserUnnsuported) { + alert("Your browser " + browserUnnsuported + " is not supported by this application.\nPlease use a browser more recent like Chrome or Firefox."); + document.body.style.display = "none"; + } +</script> </body> </html>