Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8031] MobileWeb: WebView - Adding a webview to a window doesn't show the content of the url specified when creating the webview

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2014-04-17T22:12:36.000+0000
Affected Version/sRelease 2.0.0
Fix Version/sn/a
ComponentsMobileWeb
Labelsqe-mw020912
ReporterMichael Pettiford
AssigneeBryan Hughes
Created2012-03-15T10:41:36.000+0000
Updated2014-04-17T22:12:36.000+0000

Description

Steps to reproduce 1. Create a default mobile web project and change the code in app.js to the following
var twWindow = Titanium.UI.createWindow({ 
    title: 'Michaels Twitter', 
    backgroundColor: "#fff", 
    color: "black", 
    navBarHidden: true,
    fullScreen:true

});

var webview = Ti.UI.createWebView({ 
    url: "http://www.twitter.com", 
    top: 40 
}); 


twWindow.add(webview); 
twWindow.open();
2. Run the app for mobile web Actual result: A blank page is displayed Expected result: The Twitter home page is displayed

Comments

  1. Bryan Hughes 2012-03-19

    Twitter sets an option called X-Frame-Options to SAMEORIGIN, which means that twitter.com can only be embedded in an iframe (MobileWeb's version of a webview) if the site of the parent is also twitter.com. Since your test obviously isn't running from twitter.com, the request is failing. Change the src to www.appcelerator.com and everything works fine.

JSON Source