WebViewHook
WebViewHook copied to clipboard
Potential callback to extract info out of WebView
I think it's bit cumbersome to use WebSocket just to extract simple info out of WebView.
You can see in /Assets/Editor/WebViewHook.cs that there's a lot potential callbacks. Those are what I found when browsing Editor CS source. But some how it didn't work.
The only thing that works is that LocationChanged, I figured that you can do like window.location.hash = "foobar" and that LocationChanged url param will be like https://example.com/path/to/whatever#foobar, which means it can be exploited to base for communicating and callback to C# out of JS.
Ugly. But that's a lot better than WebSocket. We should somehow implement this into WebViewHook/WebSocketHook if there's no better option found.