locked
WebView and Tumblr Posts

    Question

  • Hello,

    I'm trying to develop a social app but I noticed the WebView will show a Tumblr page but not the actual Tumblr post (just the comments) for some feeds.

    WebView

    <WebView Grid.Row="1" x:Name="webViewForTumblr" />

    Example of the WebView Not Working

    Uri uri = new Uri("http://wildstaronline.tumblr.com/post/92288823709/if-a-flock-of-protostar-employees-is-called-an-audit");
    webViewForTumblr.Navigate(uri);

    Example of WebView Working

    Uri uri = new Uri("http://mashable.tumblr.com/post/91996056683/animation-of-frank-lloyd-wrights-tree-of-life");
    webViewForTumblr.Navigate(uri);

    Is there any setting in WebView I can use to get this post to show?

    Thanks,

    Odin




    Sunday, July 20, 2014 1:06 PM

Answers

  • Ok, now I see what did you mean.

    Please refer to Matt Small's blog Ten Things You Need to Know About WebView. There are few changes in Windows 8.1 since then which you can read @ What’s new in WebView in Windows 8.1

    Now for your particular case, Tumblr uses some HTML5 & JavaScript constructs that are not supported in WebView and hence you are not able to see what is there in that aside tag (Anonymous asked etc.) which gets loaded after page has loaded, probably via JavaScript.

    If you open URL "http://html5test.com/" in WebView on Windows 8.1 Enterprise Edition, HTML5 score is 325. In regular IE i.e. Desktop version as well as Modern UI version this score is 376.

    Finally I will quote what Matt has mentioned in his Blog

    The WebView control is intended to allow a Store app developer to embed some part of the web inside the application, but should not be added to an application to allow browsing to any site on the Internet - it should be used to link specifically to pages hosted on your own website for the purposes of being displayed within your Store application.

    For example:  if you have content that you think may change quite often, it could be easier to place this information in a WebView control rather than update your application via the store. 

    However, what it is not intended to be is a portal from a Store app into a Web app.  In fact, your Store app will be rejected from listing in the Store if this is your primary use of the WebView control.


    -- Vishal Kaushik --

    Please 'Mark as Answer' if my post answers your question and 'Vote as Helpful' if it helps you. Happy Coding!!!


    Monday, July 21, 2014 7:12 PM

All replies

  • WebView will always show all HTML page for which you have given URL. Since Tumbler owns the data here any solution will depend on how they expose data i.e. RSS feed, Web Service, REST etc.

    You need to ask your question to Tumblr dev forum for possibilities of consuming data. WebView may not be the way to go at all.


    -- Vishal Kaushik --

    Please 'Mark as Answer' if my post answers your question and 'Vote as Helpful' if it helps you. Happy Coding!!!

    Sunday, July 20, 2014 4:28 PM
  • So you're saying WebView will always show all HTML for the given URL?

    But what I'm saying is just the opposite.

    Let me prove it this way.

    1. Open this URL in your browser: http://wildstaronline.tumblr.com/post/92288823709/if-a-flock-of-protostar-employees-is-called-an-audit

             You see the post that begins with "Anonymous asked:", right?

    2. Using my sample code above, just put a WebView control on a XAML page. and then paste that code that navigates to the URL above in some event that gets fired when the page loads or tie it to a button click if you want.

    3. Run the app and look at the web page through the WebView.

             Do you see the post? Do the web pages look the same? Is the WebView showing all the HTML?

    Sunday, July 20, 2014 4:48 PM
  • Ok, now I see what did you mean.

    Please refer to Matt Small's blog Ten Things You Need to Know About WebView. There are few changes in Windows 8.1 since then which you can read @ What’s new in WebView in Windows 8.1

    Now for your particular case, Tumblr uses some HTML5 & JavaScript constructs that are not supported in WebView and hence you are not able to see what is there in that aside tag (Anonymous asked etc.) which gets loaded after page has loaded, probably via JavaScript.

    If you open URL "http://html5test.com/" in WebView on Windows 8.1 Enterprise Edition, HTML5 score is 325. In regular IE i.e. Desktop version as well as Modern UI version this score is 376.

    Finally I will quote what Matt has mentioned in his Blog

    The WebView control is intended to allow a Store app developer to embed some part of the web inside the application, but should not be added to an application to allow browsing to any site on the Internet - it should be used to link specifically to pages hosted on your own website for the purposes of being displayed within your Store application.

    For example:  if you have content that you think may change quite often, it could be easier to place this information in a WebView control rather than update your application via the store. 

    However, what it is not intended to be is a portal from a Store app into a Web app.  In fact, your Store app will be rejected from listing in the Store if this is your primary use of the WebView control.


    -- Vishal Kaushik --

    Please 'Mark as Answer' if my post answers your question and 'Vote as Helpful' if it helps you. Happy Coding!!!


    Monday, July 21, 2014 7:12 PM