Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24533] Windows: WebView does not set html property

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-05-30T02:14:30.000+0000
Affected Version/sRelease 6.1.0
Fix Version/sRelease 6.2.0
ComponentsWindows
Labelswebview, windows
ReporterDerrick Huth
AssigneeKota Iguchi
Created2017-03-22T11:11:33.000+0000
Updated2017-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]

Comments

  1. Sharif AbuDarda 2017-03-22

    Hello, Can you explain the issue here? I can load the webview fine with the sample project. Thanks.
  2. Derrick Huth 2017-03-22

    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.
  3. Sharif AbuDarda 2017-03-24

    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.
  4. Eric Merriman 2017-05-15

    [~smohammed] Can you see if you can reproduce please?
  5. Samir Mohammed 2017-05-15

    [~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.
  6. Kota Iguchi 2017-05-18

    https://github.com/appcelerator/titanium_mobile_windows/pull/1000
  7. Kota Iguchi 2017-05-30

    CR & FR passed and then merged.
  8. Samir Mohammed 2017-05-31

    Verified fix in SDK version: 6.2.0.v20170531081104. Was able to view the WebView property. Tested with the following test case:
       var win = Ti.UI.createWindow(),
           webview = Ti.UI.createWebView(),
           textarea = Ti.UI.createTextArea({
               width: Ti.UI.FILL,
               height: Ti.UI.FILL
           });
       
       win.addEventListener('open', function () {
           webview.setUrl("http://www.appcelerator.com/");
       });
       
       webview.addEventListener('load', function (e) {
           setTimeout(function () {
               var html = webview.getHtml();
               textarea.value = html;
           }, 3000);
       });
       
       win.add(webview);
       win.add(textarea);
       win.open();
       
    *Test Environement*
       APPC Studio: 4.9.0.201705251638
       APPC CLI: 6.2.2
       Nokia Lumia 650 (windows 10.0)
       Operating System:
       Name = Microsoft Windows 10 Pro
       Version = 10.0.14393
       Architecture = 32bit
       CPUs = 4
       Memory = 17034395648
       Node.js:
       Node.js Version = 6.10.1
       

JSON Source