[TIMOB-24533] Windows: WebView does not set html property
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-05-30T02:14:30.000+0000 |
Affected Version/s | Release 6.1.0 |
Fix Version/s | Release 6.2.0 |
Components | Windows |
Labels | webview, windows |
Reporter | Derrick Huth |
Assignee | Kota Iguchi |
Created | 2017-03-22T11:11:33.000+0000 |
Updated | 2017-05-31T17:26:06.000+0000 |
Description
On the Windows platform the WebView ui component does not set the html property when loading web pages. This makes interacting with web pages impossible.
Sample index.js (tested with SDK 6.0.2.GA):
$.index.open();
$.webview.setUrl("http://www.perfecthomecomputers.co.uk");
$.webview.addEventListener('load',function(e) {
setTimeout( function(){
Ti.API.info("> HTML: "+$.webview.getHtml());
$.label.text = "HTML: " + $.webview.getHtml();
}, 10000);
});
The timeout was only put there just in case the html attribute became populated after the load event fired.
Sample project can be downloaded from: [https://github.com/DesHuth/titanium-test]
Hello, Can you explain the issue here? I can load the webview fine with the sample project. Thanks.
Sorry I wasn't clear, yes the webview loads content fine. What it does not do is set the html property of the webview. That is even with visible content in the webview webview.getHtml() returns "". This means the app cannot get information from the page contents. For the same reason webview.evalJS() will always return "". I need this to function for a single sign on process that returns keys in the webpage javascript functions that I would expect to access using evalJS. If you look at the above script there is a label below the webview that should display the webview html. It displays no result.
Hello, I can see the issue in Windows machine for Windows phone emulator. It does not log the webview html. The issue is not happening for Android. Moving to Engineering.
[~smohammed] Can you see if you can reproduce please?
[~emerriman] I am able to reproduce on Windows using the test case from: https://github.com/DesHuth/titanium-test Webview and Webview content is blank.
https://github.com/appcelerator/titanium_mobile_windows/pull/1000
CR & FR passed and then merged.
Verified fix in SDK version: 6.2.0.v20170531081104. Was able to view the WebView property. Tested with the following test case:
*Test Environement*