Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7965] iOS: canGoBack/canGoForward does not work for local files

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-01-24T06:09:12.000+0000
Affected Version/sRelease 1.8.2
Fix Version/sRelease 3.0.2, Release 3.1.0, 2013 Sprint 01 Core, 2013 Sprint 01, 2013 Sprint 02
ComponentsiOS
Labelsios, module_webview, notable, qe-testadded, regression
ReporterCarl Orthlieb
AssigneeMax Stepanov
Created2012-03-12T17:56:57.000+0000
Updated2013-03-15T18:28:49.000+0000

Description

1. Open and compile the attached project 2. The first web view should come up and then the alert should have values false/false as there is no history. 3. Click on the link in the view to go to the second Web View. EXPECTED RESULT: Alert should come up with values true/false as there IS an historical URL to go back to. ACTUAL RESULT: Alert comes up with false/false. In different combinations it is clear the canGoBack() and canGoForward() are not working for local files. NOTE: Also affects Android NOTE: Mobile Web does not respond to the load event at all.

Attachments

FileDateSize
Screen Shot 2012-03-12 at 6.51.28 PM.png2012-03-12T18:01:34.000+0000186648
Screen Shot 2012-03-12 at 6.51.36 PM.png2012-03-12T18:01:34.000+0000186772
TIMOB-7965.zip2012-03-15T12:56:54.000+00003656577
TIMOB-7965.zip2012-03-12T17:57:33.000+00002326691

Comments

  1. Max Stepanov 2012-03-13

    Updated FirstView.js with Back/Forward buttons.
       function view() {
       	return this.webView;
       }
       
       // FirstView Component Constructor
       function FirstView(parent) {
       	//create object instance, a parasitic subclass of Observable
       	var self = this;
       	self.parent = parent;
       	
       	self.webView = Ti.UI.createWebView({
               left: 5,    
               top: 45, 
               right: 5,
               bottom: 5,
               url : '/HTML/index.html'
           });
           self.parent.add(self.webView);
       
       	var count = 0;
           self.webView.addEventListener('load', function (e) {
              alert('goback: ' + self.webView.canGoBack() + ' gofwd: ' + self.webView.canGoForward());
           });
       
       	self.back = Ti.UI.createButton({
               left: 5,    
               top: 5, 
               width: 100,
               height: 30,
       		title: 'Back' 
       	});
       	self.parent.add(self.back);
       	self.back.addEventListener('click',function(e) {
       	   self.webView.goBack();
       	});
       	
       	self.forward = Ti.UI.createButton({
               top: 5, 
               right: 5,
       		width: 100,
               height: 30,
       		title: 'Forward' 
       	});
       	self.parent.add(self.forward);
       	self.forward.addEventListener('click',function(e) {
       	   self.webView.goForward();
       	});
           
       	return self;
       }
       
       FirstView.prototype.view = view;
       module.exports = FirstView;
       
  2. Dustin Hyde 2012-03-15

    Closing as Fixed. SDK: 2.0.0.v20120315091738 Studio: 2.0.0.201203142055 OS: Snow Leopard Devices Tested: iPod 4.3.3, iPhone Simulator 5.0, iPhone4 5.0.1, iPad2 5.1 Correct Behavior: Back loads any previous pages, stopping if there are none. Forward loads any pages that were navigated back from using the back button, stopping if there are no further pages. The alert dialogs accurately reflect the state of the webview history. Attaching new test project TIMOB-7965.zip.
  3. Dustin Hyde 2012-03-15

    TIMOB-7991 uses this same test case. It is marked as qe-testadded. When porting test case TIMOB-7965, mention TIMOB-7991 as a concurrent test.
  4. Dustin Hyde 2012-04-04

    Bug behavior now occurs. Page history is lost. Steps to Reproduce: 1. Click 'go to page 2'. 2. Click back. Expected Result: Should go back to page 1. Actual Result: Page 2 remains. SDK: 2.0.0.GA, 2.1.0.v20120404140322 Studio: 2.0.0.201203291340 OS: Snow Leopard Devices Tested: iPhone Simulator 5.0
  5. Max Stepanov 2013-01-12

    PR https://github.com/appcelerator/titanium_mobile/pull/3701
  6. Vishal Duggal 2013-01-14

    KS Webview fails to load local image
  7. Vishal Duggal 2013-01-15

    Fixed by PR https://github.com/appcelerator/titanium_mobile/pull/3701 against master
  8. Vishal Duggal 2013-01-21

    Backport Task TIMOB-12315 Backport PR https://github.com/appcelerator/titanium_mobile/pull/3750
  9. Paras Mishra 2013-01-23

    canGoBack/canGoForward works as expected in step 3. Verified on: SDK version: 3.1.0.v20130111163212,3.0.2.v20130122172624 CLI version : 3.0.23 OS : MAC OSX 10.7.5 XCode : 4.5.1
  10. Anshu Mittal 2013-01-24

    Reopening to update labels

JSON Source