Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11983] iOS: window.history.back() is not working on webViews

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionDuplicate
Resolution Date2013-01-14T15:28:25.000+0000
Affected Version/sRelease 2.1.4, Release 3.1.0
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterFederico Casali
AssigneeIngo Muschenetz
Created2012-12-06T22:04:24.000+0000
Updated2017-03-20T23:12:03.000+0000

Description

Problem description

iOS: window.history.back() is not working on webViews

Steps to reproduce

Open a webView including a link to another html page. In the new page, trigger the 'window.history.back()' function. Result: page is not going back to the previous one It works fine on Android. Sample code:
// app.js
var win = Titanium.UI.createWindow({
	backgroundColor : 'blue',
	title:'Test'
});

var wv = Ti.UI.createWebView({
	url:'index.html'
});

win.add(wv);

win.open();
// index.html
<!DOCTYPE html> 
  <html> 
    <head> 
      <title>Test</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1">
    </head> 
    <body>
      <a href="page1.html">page1</a>
    </body>
</html>
// page1.html
<!DOCTYPE html>
<html>
  <head>
    <title>Test</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script>
      function goBack() {
        window.history.back();
      }
    </script>
  </head>
  <body>
    <input type="button" onclick="goBack()" value="Back"/>
  </body>
</html>

Comments

  1. Lee Morris 2017-03-20

    Kate McGregor

JSON Source