瀏覽代碼

fix: optional chaining is not supported on older webviews (#9529)

Lucas Fernandes Nogueira 1 年之前
父節點
當前提交
705da977a9
共有 4 個文件被更改,包括 9 次插入2 次删除
  1. 6 0
      .changes/fix-script-older-os.md
  2. 0 0
      core/tauri/scripts/bundle.global.js
  3. 2 1
      core/tauri/scripts/core.js
  4. 1 1
      tooling/api/tsconfig.json

+ 6 - 0
.changes/fix-script-older-os.md

@@ -0,0 +1,6 @@
+---
+"@tauri-apps/api": patch:bug
+"tauri": patch:bug
+---
+
+Do not use JS optional chaining to prevent script errors on older webviews such as macOS 10.14.

File diff suppressed because it is too large
+ 0 - 0
core/tauri/scripts/bundle.global.js


+ 2 - 1
core/tauri/scripts/core.js

@@ -102,7 +102,8 @@
       'click',
       function (e) {
         let target = e.target
-        const baseTarget = document.querySelector('head base')?.target
+        const base = document.querySelector('head base')
+        const baseTarget = base ? base.target : null
         while (target != null) {
           if (target.matches('a')) {
             if (

+ 1 - 1
tooling/api/tsconfig.json

@@ -1,6 +1,6 @@
 {
   "compilerOptions": {
-    "target": "es2021",
+    "target": "es2019",
     "module": "esnext",
     "moduleResolution": "bundler",
     "skipLibCheck": true,

Some files were not shown because too many files changed in this diff