Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27396] iOS WKWebView: fix inverted condition on baseURL construction

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2019-10-25T15:43:59.000+0000
Affected Version/sRelease 8.0.0, Release 8.2.0
Fix Version/sRelease 8.3.0
ComponentsiOS
LabelsWKWebView, engSchedule, ios, parity
ReporterRene Pot
AssigneeVijay Singh
Created2019-09-12T12:56:29.000+0000
Updated2019-10-25T15:43:59.000+0000

Description

Ticket created on behalf of Giorgio Mandolini With the code below behavior is not the same on iOS as it is on Android.
$.webview.setHtml('<html><body><script>alert(window.location);</script></body></html>', {
    baseURL: 'https://www.google.com/'
});
The alert(window.location) outputs https://www.google.com/ on Android, while on iOS the output is file:///https://www.google.com/ I found this strange behaviour because I'm trying to insert 3rd party embeds, often without success because they internally use relative protocol URLs that are eventually resolved as file:// instead of https://. This was expected on 7.X, because of the absence of baseURL param, but on 8.X I was expected that baseURL would reflect on window.location (like it happens on Android). PR: https://github.com/appcelerator/titanium_mobile/pull/11213

Comments

  1. Vijay Singh 2019-10-07

    PR: https://github.com/appcelerator/titanium_mobile/pull/11213
  2. Satyam Sekhri 2019-10-14

    FR Passed. Waiting on Jenkins build
  3. Christopher Williams 2019-10-21

    merged to master
  4. Samir Mohammed 2019-10-25

    Closing ticket, fix verified in SDK version 8.3.0.v20191023125529. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/11213

JSON Source