locked
Open Web in Metro style app

    Question

  • Hi all,

    Could we call IE to open web in Metro style app? I'm using iframe to open web when the user click on image. But sometimes, many exception were thrown when the website use google apis or twitter, facebook… So I wanna open it in IE browser, but don't know how.

    Thanks,

    Vivian

    Monday, May 21, 2012 11:17 AM

Answers

All replies

  • Hi Vivian,

    You want to use the Launcher class for this:

    http://msdn.microsoft.com/en-us/library/windows/apps/windows.system.launcher.launchuriasync.aspx

    -Jeff


    Jeff Sanders (MSFT)

    Monday, May 21, 2012 11:31 AM
    Moderator
  • Hi Jeft,

    I got it! Thank you!

    Vivian

    Wednesday, May 23, 2012 9:19 AM
  • Hi Jeft,

    Can we open a web view internally? Do we have another option instead of iframe? I want to open webview in my app, like iOS and Android, and have a button back for user.

    Thanks,

    Vivian

    Tuesday, June 05, 2012 6:57 AM
  • Hi Vivian,

    You could navigate directly to the page with a hyperlink, this will open metro IE.

    -Jeff


    Jeff Sanders (MSFT)

    Tuesday, June 05, 2012 11:41 AM
    Moderator
  • Hi Jeft,

    I tried it. But it's not the solution that I need. I don't want to open metro IE outside. I want open it in my app, and I can add button Back in UI of web view. When user tap on button, the app will handle something. Can I do that?

    Thanks,

    Vivian

    Wednesday, June 06, 2012 2:37 AM
  • Hi Vivian and Jeft,

    I have exactly the same problem.

    We want to open an URL link inside of the application frame just like as the webkit mode in iOS so we can set a back button in the page to go back to the previous instance of the UI.

    Have you found a solution?

    Thanks

    Wednesday, June 06, 2012 8:57 AM
  • Hi R,

    The only way you could do this is to host the page in an iFrame.

    -Jeff


    Jeff Sanders (MSFT)

    Wednesday, June 06, 2012 11:40 AM
    Moderator
  • Hi Jeff

    Yes we are using iFrame but when we want to open the links e.g. Facebook, Twiter, etc. we get the following errors in <iframe>:
    ==========================================
    "http://www.facebook.com"

    *       APPHOST9613: The app couldn’t navigate to http://www.facebook.com/
    because of this error: FORBIDFRAMING.
    ==========================================

    It seems that we can not load ActiveX, Flash... in iFrame. Please kindly let us know how to solve this problem.

    Thanks

    Thursday, June 07, 2012 9:24 AM
  • Hi Rig,

    Some websites do not allow you to open their sites in a frame.  You can talk to the website owner to lift that restriction.  You cannot load flash in an iframe.  This is by design. 

    -Jeff


    Jeff Sanders (MSFT)

    Tuesday, June 12, 2012 3:43 PM
    Moderator
  • Hi,

       Do you meet this problem which I found in I call my local web site(which is in another web server in my local machine) in iframe as below:

    my codes like this:

    <section class="contentsection">   

             <div class="content">   

                 <iframe src="http://info.fredserver.net/TestServer/sugarsync.html" width="100%" height="100%"> 

               </div>    

    </section>


    "http://info.fredserver.net/TestServer/sugarsync.html" is my local test page,  info.fredserver.net is map to my current WLAN IP,  I can open this in Metro IE 10 & IE 10, but when I run in my metro style application there is an error: 

    APPHOST9613: The App Host was unable to navigate to http://info.fredserver.net/TestServer/sugarsync.html due to the following error: RESOURCE_NOT_FOUND.

    I don't know why and how to test my local web page in iframe tag, thank you.



    • Edited by fredrain Wednesday, June 13, 2012 6:04 AM
    Wednesday, June 13, 2012 5:59 AM
  • Hi Jeft,

    It seems like iframe just support to open local html files, which store in project resources. I don't know why Windows 8 not support a control like Webview in Android or Webkit mode in iOS. If I open web in IE metro, when I click to a link in web, I want to open my app, can I do that?

    Vivian

    Wednesday, June 13, 2012 8:52 AM
  • Vivian,

    You can definately include html files from your intranet.  You cannot go to localhost however because that is blocked by the loopback check by design.

    Ensure your html page is not on the same box.  Also make sure you have Home or Work Networking enabled in your manifest capabilities.

    -Jeff


    Jeff Sanders (MSFT)

    Wednesday, June 13, 2012 2:38 PM
    Moderator
  • Were you ever able to resolve this?  I'm getting the same error trying to contact a web server on our local lan.  I can hit it using IE10, but not in the iframe within my app. 

    I get the following error:

    The app couldn’t navigate to <intranet URL> because of this error: RESOURCE_NOT_FOUND

    If I change the URL to one on the internet, I'm able to open it with no problem.  It seems to only be a factor with intranet pages.

    Any help would be appreciated. 



    • Edited by nixkuroi Wednesday, November 28, 2012 10:37 PM
    Wednesday, November 28, 2012 10:36 PM
  • You have to allow 'Private Networks' in your capabilities tab of your manifest.


    Jeff Sanders (MSFT)

    Tuesday, December 04, 2012 4:47 PM
    Moderator
  • to use of hyperlink.
    • Proposed as answer by TK MAHATO Wednesday, December 19, 2012 9:55 AM
    Tuesday, December 18, 2012 6:37 PM