Exemplo n.º 1
0
 void OnActionAdded(FormsWebView sender, string key, bool isGlobal)
 {
     if (isGlobal || sender.Equals(Element))
     {
         InjectJS(WebViewControlDelegate.GenerateFunctionScript(key));
     }
 }
 void OnActionAdded(FormsWebView sender, string key, bool isGlobal)
 {
     if (isGlobal || (Element != null && Element.Equals(sender)))
     {
         InjectJavascript(WebViewControlDelegate.GenerateFunctionScript(key));
     }
 }
Exemplo n.º 3
0
 async void OnActionAdded(FormsWebView sender, string key, bool isGlobal)
 {
     if (isGlobal || Element.Equals(sender))
     {
         await Control.InvokeScriptAsync("eval", new[] { WebViewControlDelegate.GenerateFunctionScript(key) });
     }
 }
 private async void OnActionAdded(FormsWebView sender, string key)
 {
     if (Element == sender && Control != null)
     {
         await Control.InvokeScriptAsync("eval", new[] { WebViewControlDelegate.GenerateFunctionScript(key) });
     }
 }
Exemplo n.º 5
0
        public override void DidFinishNavigation(WKWebView webView, WKNavigation navigation)
        {
            Renderer.InjectJS(WebViewControlDelegate.InjectedFunction);
            foreach (var key in Element.GetAllCallbacks())
            {
                Renderer.InjectJS(WebViewControlDelegate.GenerateFunctionScript(key));
            }

            Element.InvokeEvent(WebViewEventType.ContentLoaded, new ContentLoadedDelegate(Element, webView.Url.AbsoluteUrl.ToString()));
        }
Exemplo n.º 6
0
        public override void OnPageFinished(Android.Webkit.WebView view, string url)
        {
            Renderer.InjectJS(WebViewControlDelegate.InjectedFunction);
            foreach (var key in Element.GetAllCallbacks())
            {
                Renderer.InjectJS(WebViewControlDelegate.GenerateFunctionScript(key));
            }

            Element.InvokeEvent(WebViewEventType.ContentLoaded, new ContentLoadedDelegate(Element, url));
            base.OnPageFinished(view, url);
        }
        private async void OnContentLoaded(Windows.UI.Xaml.Controls.WebView sender, Windows.UI.Xaml.Controls.WebViewDOMContentLoadedEventArgs args)
        {
            await Control.InvokeScriptAsync("eval", new[] { WebViewControlDelegate.InjectedFunction });

            foreach (var key in Element.GetAllCallbacks())
            {
                await Control.InvokeScriptAsync("eval", new[] { WebViewControlDelegate.GenerateFunctionScript(key) });
            }

            Element.InvokeEvent(WebViewEventType.ContentLoaded, new ContentLoadedDelegate(Element, args.Uri != null ? args.Uri.AbsoluteUri : ""));
        }
Exemplo n.º 8
0
        public override void OnPageFinished(Android.Webkit.WebView view, string url)
        {
            Renderer.InjectJS(WebViewControlDelegate.InjectedFunction);
            foreach (var key in Element.GetAllCallbacks())
            {
                Renderer.InjectJS(WebViewControlDelegate.GenerateFunctionScript(key));
            }

            Element.SetValue(FormsWebView.UriProperty, url);

            Element.InvokeEvent(WebViewEventType.NavigationComplete, new NavigationCompletedDelegate(Element, url, true));
            base.OnPageFinished(view, url);
        }
        public override void DidFinishNavigation(WKWebView webView, WKNavigation navigation)
        {
            Renderer.InjectJS(WebViewControlDelegate.InjectedFunction);
            foreach (var key in Element.GetAllCallbacks())
            {
                Renderer.InjectJS(WebViewControlDelegate.GenerateFunctionScript(key));
            }

            if (webView.Url.AbsoluteUrl != null)
            {
                Element.SetValue(FormsWebView.UriProperty, webView.Url.AbsoluteUrl.ToString());
            }

            Element.InvokeEvent(WebViewEventType.NavigationComplete, new NavigationCompletedDelegate(Element, webView.Url.AbsoluteUrl.ToString(), true));
        }
        private async void OnNavigated(Windows.UI.Xaml.Controls.WebView sender, Windows.UI.Xaml.Controls.WebViewNavigationCompletedEventArgs args)
        {
            await Control.InvokeScriptAsync("eval", new[] { WebViewControlDelegate.InjectedFunction });

            foreach (var key in Element.GetAllCallbacks())
            {
                await Control.InvokeScriptAsync("eval", new[] { WebViewControlDelegate.GenerateFunctionScript(key) });
            }

            var uri = args.Uri != null ? args.Uri.AbsoluteUri : "";

            Element.SetValue(FormsWebView.UriProperty, uri);

            Element.InvokeEvent(WebViewEventType.NavigationComplete, new NavigationCompletedDelegate(Element, uri));
        }
Exemplo n.º 11
0
        public override void DidFinishNavigation(WKWebView webView, WKNavigation navigation)
        {
            Renderer.InjectJS(WebViewControlDelegate.InjectedFunction);

            foreach (var key in Element.GetLocalCallbacks())
            {
                Renderer.InjectJS(WebViewControlDelegate.GenerateFunctionScript(key));
            }

            foreach (var key in Element.GetGlobalCallbacks())
            {
                Renderer.InjectJS(WebViewControlDelegate.GenerateFunctionScript(key));
            }

            Element.InvokeEvent(WebViewEventType.NavigationStackUpdate, new NavigationStackUpdateDelegate(Element, Renderer.Control.CanGoBack, Renderer.Control.CanGoForward));
            Element.InvokeEvent(WebViewEventType.ContentLoaded, new ContentLoadedDelegate(Element, webView.Url.AbsoluteUrl.ToString()));
        }
Exemplo n.º 12
0
        async void OnContentLoaded(Windows.UI.Xaml.Controls.WebView sender, Windows.UI.Xaml.Controls.WebViewDOMContentLoadedEventArgs args)
        {
            await Control.InvokeScriptAsync("eval", new[] { WebViewControlDelegate.InjectedFunction });

            foreach (var key in Element.GetLocalCallbacks())
            {
                await Control.InvokeScriptAsync("eval", new[] { WebViewControlDelegate.GenerateFunctionScript(key) });
            }

            foreach (var key in Element.GetGlobalCallbacks())
            {
                await Control.InvokeScriptAsync("eval", new[] { WebViewControlDelegate.GenerateFunctionScript(key) });
            }

            Element.InvokeEvent(WebViewEventType.NavigationStackUpdate, new NavigationStackUpdateDelegate(Element, Control.CanGoBack, Control.CanGoForward));
            Element.InvokeEvent(WebViewEventType.ContentLoaded, new ContentLoadedDelegate(Element, args.Uri != null ? args.Uri.AbsoluteUri : ""));
        }
Exemplo n.º 13
0
        public override void OnPageFinished(Android.Webkit.WebView view, string url)
        {
            Element.InvokeEvent(WebViewEventType.NavigationComplete, new NavigationCompletedDelegate(Element, url, true));
            Renderer.InjectJS(WebViewControlDelegate.InjectedFunction);

            foreach (var key in Element.GetGlobalCallbacks())
            {
                Renderer.InjectJS(WebViewControlDelegate.GenerateFunctionScript(key));
            }

            foreach (var key in Element.GetLocalCallbacks())
            {
                Renderer.InjectJS(WebViewControlDelegate.GenerateFunctionScript(key));
            }

            Element.InvokeEvent(WebViewEventType.NavigationStackUpdate, new NavigationStackUpdateDelegate(Element, Renderer.Control.CanGoBack(), Renderer.Control.CanGoForward()));
            Element.InvokeEvent(WebViewEventType.ContentLoaded, new ContentLoadedDelegate(Element, url));
            base.OnPageFinished(view, url);
        }
 private void OnActionAdded(FormsWebView sender, string key)
 {
     InjectJS(WebViewControlDelegate.GenerateFunctionScript(key));
 }