Skip to content

Fix/add script message handler async - #4

Open
XinZhangBambu wants to merge 4 commits into
bambulab:masterfrom
XinZhangBambu:fix/add-script-message-handler-async
Open

Fix/add script message handler async#4
XinZhangBambu wants to merge 4 commits into
bambulab:masterfrom
XinZhangBambu:fix/add-script-message-handler-async

Conversation

@XinZhangBambu

Copy link
Copy Markdown
Collaborator

No description provided.

XinZhangBambu and others added 4 commits March 28, 2025 11:22
On macOS, AddScriptMessageHandler() injected its window.<name> alias into the current document via the synchronous RunScript() -> RunScriptSync(), which busy-waits with while(!done) wxYield() for evaluateJavaScript's completion handler. When the WKWebView is off-screen / in a background tab, macOS can throttle or suspend its WebContent process so the handler never fires, hanging the main thread. Add a runScriptSync parameter (default true, preserving behavior); when false the alias is injected asynchronously. GTK mirrors the flag; Edge ignores it (no sync RunScript).

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant