瀏覽代碼

feat: alert not supporting when using IE browser

wangweimin 4 年之前
父節點
當前提交
0d6d7abce1
共有 2 個文件被更改,包括 8 次插入1 次删除
  1. 4 0
      pywebio/html/index.html
  2. 4 1
      pywebio/platform/tpl/index.html

+ 4 - 0
pywebio/html/index.html

@@ -56,6 +56,10 @@
 <script src="js/bs-custom-file-input.min.js"></script> <!-- bootstrap custom file input-->
 <script src="js/purify.min.js"></script>  <!-- XSS sanitizer -->
 
+<script>
+    if (window.navigator.userAgent.indexOf('MSIE ') !== -1 || window.navigator.userAgent.indexOf('Trident/') !== -1)
+        $('#output-container').html('<div class="alert alert-danger" role="alert"> Sorry, this website does not support IE browser. ☹ </div>');
+</script>
 <script src="js/pywebio.min.js"></script>
 
 <script src="js/require.min.js"></script> <!-- JS module loader -->

+ 4 - 1
pywebio/platform/tpl/index.html

@@ -48,7 +48,10 @@
 <script src="{{ base_url }}js/toastify.min.js"></script> <!-- toast -->
 <script src="{{ base_url }}js/bs-custom-file-input.min.js"></script> <!-- bootstrap custom file input-->
 <script src="{{ base_url }}js/purify.min.js"></script>  <!-- XSS sanitizer -->
-
+<script>
+    if (window.navigator.userAgent.indexOf('MSIE ') !== -1 || window.navigator.userAgent.indexOf('Trident/') !== -1)
+        $('#output-container').html('<div class="alert alert-danger" role="alert"> Sorry, this website does not support IE browser. ☹ </div>');
+</script>
 <script src="{{ base_url }}js/pywebio.min.js"></script>
 
 <script src="{{ base_url }}js/require.min.js"></script> <!-- JS module loader -->