Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5471] iOS: webview.reload() bug if website has iframe(s)

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-05-08T07:14:14.000+0000
Affected Version/sRelease 1.7.2, Release 2.0.1
Fix Version/s2013 Sprint 10
ComponentsiOS
Labelsapi
ReporterEduardo Gomez
Assigneejithinpv
Created2011-10-09T12:37:14.000+0000
Updated2017-03-23T21:13:12.000+0000

Description

Problem

webview.reload() bug if website has iframe(s). If website is reloaded from Safari entire site is shown.

Tested on

iOS Simulator 4.3 & iPod 4.2

Repro sequence

var win = Ti.UI.createWindow();

//webview toolbar buttons
var btnBack = Ti.UI.createButton({
	width: 50,title:'<',
	//image: '../img/icon_arrow_left.png',
	enabled: false
});

	//event: back
	btnBack.addEventListener('click', function(){
		webView.goBack();
    });

var btnFwd = Ti.UI.createButton({
	width: 50,title:'>',
	//image: '../img/icon_arrow_right.png',
	enabled: false
});

	//event: forward
	btnFwd.addEventListener('click', function(){
		webView.goForward();
    });

var btnReload = Ti.UI.createButton({
	systemButton:Titanium.UI.iPhone.SystemButton.REFRESH, 
	visible: false
});

	//event: reload
	btnReload.addEventListener('click', function(){
		webView.reload();
    });

var btnLoading = Ti.UI.createButton({
	systemButton:Titanium.UI.iPhone.SystemButton.SPINNER,
});

var btnSpace = Titanium.UI.createButton({
	systemButton:Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE
});


//webview
var webView = Ti.UI.createWebView({
	url: 'http://www.borsen.dk'
});
win.add(webView);

	//event: before load
	webView.addEventListener('beforeload',function(e){
		webViewToolbar.items = [btnBack, btnFwd, btnSpace, btnLoading, btnSpace];
	});


	//event: load
	webView.addEventListener('load',function(e){

		webViewToolbar.items = [btnBack, btnFwd, btnSpace, btnReload, btnSpace];

		//ctrl: back
		if(webView.canGoBack()){
			btnBack.enabled = true;
		} else {            
			btnBack.enabled = false;
		}

		//ctrl: fwd
		if(webView.canGoForward()){
			btnFwd.enabled = true;
		} else {            
			btnFwd.enabled = false;
		}
    });



//webview toolbar
var webViewToolbar = Ti.UI.createToolbar({
	items: [btnBack, btnFwd, btnSpace, btnReload, btnLoading, btnSpace],
	bottom: 0,
	barColor: win.barColor
});
win.add(webViewToolbar);

win.open();

Associated HD ticket

APP-555912

Comments

  1. Junaid Younus 2012-05-16

    Tested with 2.0.1GA2 on the iOS simulator, the issue is still valid. The webpage is rendered fine, however at the bottom, you will see that it is 'truncating' parts of the page.
  2. jithinpv 2013-05-08

    cannot reproduce Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 iOS iPhone Simulator: iOS SDK version: 6.0
  3. Lee Morris 2017-03-23

    Can verify this ticket as "Cannot Reproduce". Tested with the following environment; iPhone 7 and Simulator (10.2) MacOS 10.11.6 (15G31) Studio 4.8.1.201612050850 Ti SDK 6.0.3 GA Appc NPM 4.2.8 Appc CLI 6.1.0 Ti CLI 5.0.11 Alloy 1.9.5 Arrow 1.10.1 Xcode 8.2 (8C38) Node v4.6.0 Java 1.7.0_80

JSON Source