Commit 4f2c6e8
committed
fix: add WebView to view hierarchy to enable JavaScript execution
CRITICAL FIX: WKWebView on macOS requires being in the view hierarchy
to properly execute JavaScript. The WebView was created but never added
to any view, causing JavaScript (including the game-bridge callbacks) to
never execute.
Changes:
- Set webView.hidden = NO (was YES)
- Position WebView offscreen (-10000, -10000) with minimal size (1x1)
- Add WebView to main window's content view
- Add logging for debugging
This ensures JavaScript runs even though the WebView UI is not visible
to the user.1 parent 2ef106b commit 4f2c6e8
2 files changed
Lines changed: 15 additions & 1 deletion
File tree
- Plugins/Mac/Sources
- src/Packages/Passport/Runtime/ThirdParty/Gree/Assets/Plugins/ImmutableWebView.bundle/Contents/MacOS
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
147 | 161 | | |
148 | 162 | | |
149 | 163 | | |
| |||
Binary file not shown.
0 commit comments