Commit 23e89cf
committed
fix: improve macOS WebView initialization for JavaScript execution
CHANGES:
- Increased WebView size from 1x1 to 100x100 (minimum viable size)
- Changed positioning: use setAlphaValue:0 (transparent) instead of offscreen (-10000, -10000)
- Improved console.log capture: preserve original console.log and forward to Unity
- Prevents breaking JavaScript libraries that depend on console.log
RATIONALE:
WKWebView may not properly initialize or execute JavaScript with extremely
small sizes (1x1). Using 100x100 with alpha=0 ensures the WebView is functional
while remaining invisible to the user.1 parent c16efdb commit 23e89cf
2 files changed
Lines changed: 12 additions & 5 deletions
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 | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
123 | 129 | | |
124 | 130 | | |
125 | 131 | | |
| |||
144 | 150 | | |
145 | 151 | | |
146 | 152 | | |
147 | | - | |
148 | | - | |
| 153 | + | |
| 154 | + | |
149 | 155 | | |
150 | | - | |
| 156 | + | |
| 157 | + | |
151 | 158 | | |
152 | 159 | | |
153 | 160 | | |
154 | 161 | | |
155 | 162 | | |
156 | 163 | | |
157 | | - | |
| 164 | + | |
158 | 165 | | |
159 | 166 | | |
160 | 167 | | |
| |||
Binary file not shown.
0 commit comments