B4X FEED [Solved] WKWebview - messages from Javascript to B4I without _OverrideURL

اطلاعات موضوع

درباره موضوع در تاریخ, در دسته b4xfeed ایجاد شده و آغاز کننده آن practicalsoftمی باشد و موضوع آن: [Solved] WKWebview - messages from Javascript to B4I without _OverrideURL است. این موضوع تا کنون 53 بازدید کننده و, 0 پاسخ داشته و 0 بار پسندیده شده...
نام دسته b4xfeed
نام موضوع [Solved] WKWebview - messages from Javascript to B4I without _OverrideURL
آغاز کننده موضوع practicalsoft
تاریخ شروع
پاسخ‌ها
0
بازدیدها
53
پسندها
0
آخرین ارسال توسط PracticalSoft
Jun 6, 2020
11,559
4,422
I'm using a WKWebview to display 3D models with Three.js. Calling Javascript functions from B4I is simple with Webview.EvaluateJavaScript and works flawlessly.

It is recommended to use OverrideURL to send messages the other way around from Javascript to B4I. While this works, it is too slow for my use case. I'd like to get the 3D orientation of the model at 60 Hz. In B4A I use warwound's WebViewExtras.addJavascriptInterface for that purpose.

Emme Developer posted a very interesting solution which uses the Webview's userController:
This solution works great for sending messages in 'realtime' but the standard events are not raised anymore.

Does anyone have an idea how to use Emme Developer's solution and keep the standard events (most importantly _PageFinished and _JSComplete) at the same time?

I tried to combine the userController with the navigationDelegate from Erel's post but I couldn't get the events to be raised.

 

عقب
بالا