public static void LoadLocalHtml(WebView webView, string path) { CardStreamUriWinRTResolver resolver = new CardStreamUriWinRTResolver(); var localUri = webView.BuildLocalStreamUri("HtmlViewer", path); webView.NavigateToLocalStreamUri(localUri, resolver); }
public void NavigateWebviewToLocalPage() { TinymceStreamUriWinRTResolver resolver = new TinymceStreamUriWinRTResolver(); var localUri = webViewControl.BuildLocalStreamUri("HtmlEditor", htmlFilePath); webViewControl.NavigateToLocalStreamUri(localUri, resolver); }
/// <summary> /// Show local page in cordova view /// </summary> protected void LoadLocalStartPage() { WebView browser = GetWebView(); Uri url = browser.BuildLocalStreamUri(StreamResolverKey, _bootConfig.StartPage); // Pass the resolver object to the navigate call. browser.NavigateToLocalStreamUri(url, new StreamUriResolver()); }
public void Load(WebView sandboxWebView) { _sandboxWebView = sandboxWebView; _sandboxWebView.NavigationCompleted += _sandboxWebView_NavigationCompleted; _sandboxWebView.ScriptNotify += SandboxWebViewOnScriptNotify; _sandboxWebView.NavigateToLocalStreamUri(_sandboxWebView.BuildLocalStreamUri("autc", "/sandbox.html"), new LocalUriResolver()); }
public AnnouncementControl() { this.InitializeComponent(); var content = Content as FrameworkElement; content.DataContext = this; var uri = WebView.BuildLocalStreamUri("AZME", "/Html/Rebound/rebound.html"); WebView.NavigateToLocalStreamUri(uri, new AbstractWebPage.WebViewContainerResolver()); }
/// <summary> /// Show local page in cordova view /// </summary> protected void LoadLocalStartPage() { WebView browser = GetWebView(); Uri url = browser.BuildLocalStreamUri(StreamResolverKey, _bootConfig.StartPage); string relativePath = url.PathAndQuery; var appDataUri = new Uri("ms-appx-web://" + relativePath); browser.Navigate(appDataUri); }
/// <summary> /// Gets called when the monitoring WebView loads an HTML file and /// </summary> /// <param name="sender">The WebView calling this method</param> /// <param name="args">The event arguments</param> /// <exception cref="NotSupportedException">Following protocol is not supported for Hybrid requests</exception> protected virtual void WebViewOnDomContentLoaded(WebView sender, WebViewDOMContentLoadedEventArgs args) { if (sender != WebView) { return; } if (args.Uri == null) { throw new NotSupportedException( "NavigateToString is not supported when using WebViewHybridBridge class."); } if (args.Uri.Scheme == "ms-local-stream") { PushJavascript(); } else if (args.Uri.Scheme == @"ms-appdata") { if (CustomUriToStreamResolver == null) { CustomUriToStreamResolver = new UriToAppDataResolver(); } sender.NavigateToLocalStreamUri( sender.BuildLocalStreamUri("WebViewHybridBridge", args.Uri.PathAndQuery), BridgeResolver); } else if (args.Uri.Scheme == @"ms-appx-web") { if (CustomUriToStreamResolver == null) { CustomUriToStreamResolver = new UriToAppxResolver(); } sender.NavigateToLocalStreamUri( sender.BuildLocalStreamUri("WebViewHybridBridge", args.Uri.PathAndQuery), BridgeResolver); } else { throw new NotSupportedException( "HTTP navigation is not supported when using WebViewHybridBridge class."); } }