diff --git a/src/index.html b/src/index.html index f944aa7b1c9a37a8995f39cb1e8cb200a359b952..55ed7b6156871cd5192c5499c6607793000deddd 100644 --- a/src/index.html +++ b/src/index.html @@ -17,5 +17,35 @@ <span class = "homeAnimationDots loadingAnimationDots">•</span> </h1> </atlas-viewer> + <script> + /** + * Catching Safari 10 bug: + * + * https://bugs.webkit.org/show_bug.cgi?id=171041 + * + */ + try{ + eval('(()=>{\ + let e = e => {\ + console.log(e);\ + for(let e of [1,2,3]){\ + console.log(e);\ + }\ + }\ + })()') + }catch(e){ + console.log(e) + const warning = 'Your browser cannot display the interactive viewer. Please use either Chrome >= 56 and/or Firefox >= 51' + console.log(warning) + const warningEl = document.createElement('h4') + warningEl.innerHTML = warning + const el = document.getElementsByTagName('atlas-viewer') + if(el.length > 0){ + document.body.removeChild(el[0]) + } + document.body.appendChild(warningEl) + } + + </script> </body> </html> \ No newline at end of file