Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20143] Windows: Titanium.UI.WebView don't load local html page

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2015-12-21T20:08:34.000+0000
Affected Version/sRelease 5.1.1
Fix Version/sRelease 5.3.0
ComponentsWindows
Labelsqe-5.3.0, webview, windows, windows8.1
ReporterLuca Sartori
AssigneeKota Iguchi
Created2015-12-09T12:16:34.000+0000
Updated2016-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;

Comments

  1. Toshiro Yagi 2015-12-19

    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}
  2. Kota Iguchi 2015-12-19

    https://github.com/appcelerator/titanium_mobile_windows/pull/510
  3. Luca Sartori 2015-12-19

    Thanks you! The workaround works well. Luca
  4. Harry Bryant 2016-04-13

    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.*

JSON Source