Skip to content

Commit

Permalink
fix: optional chaining is not supported on older webviews (#9530)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Apr 22, 2024
1 parent 70c5137 commit 35b25f7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changes/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.
4 changes: 4 additions & 0 deletions core/tauri/permissions/webview/autogenerated/reference.md
Expand Up @@ -20,8 +20,12 @@
|`deny-set-webview-zoom`|Denies the set_webview_zoom command without any pre-configured scope.|
|`allow-webview-close`|Enables the webview_close command without any pre-configured scope.|
|`deny-webview-close`|Denies the webview_close command without any pre-configured scope.|
|`allow-webview-hide`|Enables the webview_hide command without any pre-configured scope.|
|`deny-webview-hide`|Denies the webview_hide command without any pre-configured scope.|
|`allow-webview-position`|Enables the webview_position command without any pre-configured scope.|
|`deny-webview-position`|Denies the webview_position command without any pre-configured scope.|
|`allow-webview-show`|Enables the webview_show command without any pre-configured scope.|
|`deny-webview-show`|Denies the webview_show command without any pre-configured scope.|
|`allow-webview-size`|Enables the webview_size command without any pre-configured scope.|
|`deny-webview-size`|Denies the webview_size command without any pre-configured scope.|
|`default`|Default permissions for the plugin.|
2 changes: 1 addition & 1 deletion core/tauri/scripts/bundle.global.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/tauri/scripts/ipc-protocol.js
Expand Up @@ -29,7 +29,7 @@
'Content-Type': contentType,
'Tauri-Callback': callback,
'Tauri-Error': error,
...options?.headers
...((options && options.headers) || {})
}
})
.then((response) => {
Expand Down
2 changes: 1 addition & 1 deletion tooling/api/tsconfig.json
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es2021",
"target": "es2019",
"module": "esnext",
"moduleResolution": "bundler",
"skipLibCheck": true,
Expand Down

0 comments on commit 35b25f7

Please sign in to comment.