Telerik-Verified-Plugins / WKWebView

DEPRECATED - this plugin served a purpose in the past, but there are better implementation now

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AppBuilder debug on device does not work in 0.6.9

ventsislav-georgiev opened this issue · comments

The AppBuilder's Debug On Device stopped working with the release of 0.6.9 version.

The reason of the issue came out to be the changes from 4f83a17#diff-c5ff2ff62349ac98d4b59297d579c5bdR49

One of the ways the AppBuilder client allows debugging of an app deployed on device is by using DevTools. They are initialized for the current location of the debuggable application's webview.

I made a test case with a new project from the Kendo UI TabStrip template. After the application loads the webview's current location is expected to be:
"http://localhost:{port}/index.html#components/homeView/view.html".

The location of the webview changes a few times during the application's loading and for the "Kendo UI TabStrip" project is expected to have the url of the Home view at the end. Here is how the location was updating before and after the change.
Before the change:

After the change it is acting strange:

Also after the change, every time a javascript code access the window.location object the AppBuilder client again detects this other view "JSContext".

The missing location is causing DevTools fail to initialize.

I am able to reproduce the issue with older versions of the plugin as well. Here are the steps:

  1. Install and open AppBuilder Windows Client. Then login.
  2. Create a new project using Kendo UI Tab Strip template. In fact, I was testing with one specific project which appeared to have the Kendo UI HTML Framework. It also had InAppBrowser plugin installed (although I don't think it is significant for this case).
  3. Go to Properties -> Plugins -> Install From Plugins Marketplace. In the search field type WKWebView and before clicking on install make use to have chosen v0.6.8 (or even older).
  4. Connect a device and choose from the Run dropdown, Build and Deploy. So far I have tested it on iOS 9.0 and 8.3.
  5. After the deployment finishes, open the app and then kill it (I am not fully convinced that this step is actually required). Then open the app again and back in AppBuilder Windows client, from the device section (bottom right corner), choose Debug. This will start a Web Inspector
  6. The Web Inspector (debugger) fails to load the app resources with the following error An error occured trying to load the resource..

My observations so far have lead me to believe that it is an error with Kendo UI HTML Framework and WKWebView. The issue didn't appear to reproduce with a simple blank Cordova project but this should be further tested and confirmed.
From the logs that I have observed, it seems that the WKWebView's local web server doesn't serve the requested resources correctly but again I can't confirm this as need more time to investigate.

After additional research it seems that the issue is not related to the WKWebView plugin.
Apps that use the WKWebView have multiple processes and we were not attaching to the correct one every time. A fix will be applied in the AppBuilder clients.