Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16821] iOS/Android : Support window.location.search for local files in WebView

GitHub Issuen/a
TypeImprovement
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.2.2
Fix Version/sn/a
Componentsn/a
Labelsquerystring, webview
ReporterFokke Zandbergen
AssigneeUnknown
Created2014-04-03T11:44:35.000+0000
Updated2018-02-28T20:03:10.000+0000

Description

If you load a local file into a webview like this:
var win = Ti.UI.createWindow();
win.add(Ti.UI.createWebView({
  url: 'index.html?foo=bar'
}));
win.open();
The following index.html results in the attached screenshot, showing the query string is not found in window.location.search:
<html>
  <body bgcolor="#ddd">
    <pre id="dump" style="margin-top:20px" />
    <script>
    document.getElementById('dump').innerHTML = JSON.stringify(window.location, null, '  ');
    </script>
  </body>
</html>
This is unfortunate since I'd like to use the query string to pass parameters to the static HTML. I know I can wait for the WebView's load event and then evalJS, but my benchmarks show I loose a lot of valuable time this way.

Attachments

FileDateSize
iOS-simulatorschermafbeelding 3 apr. 2014 13.39.18.png2014-04-03T11:44:35.000+000053262

Comments

  1. Ritu Agrawal 2014-04-07

    Moving this enhancement request to Engineering for further evaluation and prioritization.

JSON Source