Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

WebView UWP

Discussion in 'Windows' started by ems316, Oct 12, 2016.

  1. ems316

    ems316

    Joined:
    Jun 8, 2015
    Posts:
    4
    Does anyone know if there is support for displaying a WebView in a 3D context on UWP? I've been trying to get this functionality out, but I've been running into major issues. Currently there are no APIs that expose this functionality (Awesomium doesn't support UWP, uWebKit discontinued, NoesisGUI doesn't support WebView, etc). The only way that has worked is by using ApplicationViewSwitcher and using switchasync, however, this just switches the context of the application from 3D to 2D and forces users to toggle their views. Any help would be appreciated!
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,673
    Other people here used https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.webview.aspx successfully, which is simply shown above Unity content as a XAML element, just make it as a child of swapchainpanel in MainPage.xaml.
     
  3. ems316

    ems316

    Joined:
    Jun 8, 2015
    Posts:
    4
    Do you know of any examples that showcase this effort?
     
  4. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,673
    No, I don't, but it's so simple, that I don't think you need one.

    Just open MainPage.xaml, drag WebView component (from Tools pane) on the page, then slightly modify MainPage.xaml code, because WebView component by default will be assigned as a child of splash screen, thus will be removed when splash screen disappear. Make it a child of swapchain panel.

    Done
     
  5. jwittner

    jwittner

    Joined:
    Dec 2, 2015
    Posts:
    6