Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19259] iOS: WebView loses the DOM on a subsequent "open" of the containing window

GitHub Issuen/a
TypeBug
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelshtml, load, webview
ReporterGopi Reddy
AssigneeUnknown
Created2015-07-25T14:28:52.000+0000
Updated2018-02-28T19:55:06.000+0000

Description

The WebView used to keep its DOM across multiple open-close cycles of the containing window. We could even remove the WebView instance from one window and add it to another window, without losing the DOM. This was a great feature for performance. Somewhere between 3.4.1.GA and 4.1.0.GA, this behavior changed. Now, the WebView reloads on each open of the containing Window. I think this was done to fire the "load" event on the WebView on each window.open(). If you set the HTML of the WebView, as opposed to setting its URL, then the WebView tries to load an empty local URL on subsequent window.open(), with just the App's directory, and fails. To recreate this issue:

Create a master-detail app from the template

Replace DetailView.js with the attached file:

Run and click on a master row. The detail window will show the details. Go back and click another master row. [Please keep the old behavior *_as an option_*. We should be able to keep the WebView instance across multiple open-close cycles without losing its DOM. We should even be able to move the WebView instance across windows.]

Attachments

FileDateSize
DetailView.js2015-07-25T14:35:44.000+0000394
MasterView.js2015-07-25T14:35:44.000+0000912

Comments

  1. Gopi Reddy 2015-07-29

    We fixed a few critical bugs in our app but we cannot deploy the app to the Apple store until this issue is resolved. We cannot fallback to an older version of the SDK because the app store requires a 64-bit version. We are stuck between a rock and a hard place. An ETA will be greatly appreciated. Our app requires that the old behavior of the SDK is restored. This means that the DOM of the web document in a WebView stays intact even if the containing window is closed and reopened. If this cannot be made available by default, then please provide it through an option in the WebView component.

JSON Source