Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds an option for JavaScript evaluation to run via WebKit’s async JavaScript mechanism (Promise-based), exposing it both to the Shortcuts intent and AppleScript scripting interface.
Changes:
- Add a
callAsync/callAsyncJavaScriptboolean parameter to opt into Promise-based JS evaluation. - Route JS evaluation through a new
WKWebView.evaluateJavaScript(_:callAsync:completionHandler:)helper that usescallAsyncJavaScriptwhen enabled. - Update the scripting definition (
.sdef) and string catalog entries to reflect the new parameter and related UI strings.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| MarkEditMac/Sources/Shortcuts/Intents/EvaluateJavaScriptIntent.swift | Adds callAsync intent parameter and uses the new WKWebView helper overload. |
| MarkEditMac/Sources/Scripting/EditorDocument+Scripting.swift | Adds AppleScript argument parsing for callAsyncJavaScript and passes it into JS evaluation. |
| MarkEditMac/Resources/MarkEdit.sdef | Adds callAsyncJavaScript boolean parameter to the scripting dictionary. |
| MarkEditMac/Resources/Localizable.xcstrings | Adds localizations for the new parameter title/description and updates related extracted strings. |
| MarkEditKit/Sources/Extensions/WKWebView+Extension.swift | Introduces the callAsync-aware JS evaluation wrapper using callAsyncJavaScript. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
No description provided.