[TIMOB-20143] Windows: Titanium.UI.WebView don't load local html page
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-12-21T20:08:34.000+0000 |
Affected Version/s | Release 5.1.1 |
Fix Version/s | Release 5.3.0 |
Components | Windows |
Labels | qe-5.3.0, webview, windows, windows8.1 |
Reporter | Luca Sartori |
Assignee | Kota Iguchi |
Created | 2015-12-09T12:16:34.000+0000 |
Updated | 2016-04-15T15:09:51.000+0000 |
Description
I cannot load local html page (located in Resources directory)
This code works on Android and iOS but on Windows 8.1 give "Unknow error"
var htmlPage = "/help.html";
$.webview.url = htmlPage;
This workaround code on Windows 8.1 don't give any error but don't load the page (blank screen)
var htmlPage = Ti.Filesystem.resourcesDirectory + Ti.Filesystem.separator + "help.html";
$.webview.url = htmlPage;
Assuming you have Resources/help.html or app/assets/help.html in your project directory, here's my workaround: {noformat} var htmlPage = "/help.html"; if(OS_WINDOWS){ htmlPage = "ms-appx-web://" + htmlPage; } $.webview.url = htmlPage; {noformat}
https://github.com/appcelerator/titanium_mobile_windows/pull/510
Thanks you! The workaround works well. Luca
Verified as fixed, WebView with local html file now opens correctly without issue on windows devices. Tested on: Windows 10 Pro Windows Phone 10.0 & 8.1 (Microsoft Lumia 640 LTE) Appc Studio: 4.6.0.201604081249 Ti SDK: 5.3.0.v20160413061223 Appc NPM: 4.2.5-1 Appc Core: 5.3.0-12 Node: v4.4.2 *Closing Ticket.*