tianyun 1 年之前
父節點
當前提交
c3d8906ea1
共有 1 個文件被更改,包括 13 次插入0 次删除
  1. 13 0
      simple-demo/js/util.js

+ 13 - 0
simple-demo/js/util.js

@@ -397,3 +397,16 @@ async function convertToWebPAsync(base64Image) {
         return webpData;
     }
 }
+
+
+function closeWindow(){
+    const userAgent = navigator.userAgent;
+    if (userAgent.indexOf("Firefox") != -1 || userAgent.indexOf("Chrome") !=-1) {
+        window.location.href="about:blank";
+        window.close();
+    } else {
+        window.opener = null;
+        window.open("", "_self");
+        window.close();
+    }
+}