SKLn-Rad / Xam.Plugin.Webview

Xamarin Plugin for a HybridWebView in PCL projects.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to handle navigation erros with “xamarin + Xam.Plugin.Webview” cross-platform

Flying-Light opened this issue · comments

I am using xamarin + Xam.Plugin.Webview to build a cross-platform application "https://github.com/SKLn-Rad/Xam.Plugin.Webview"

Everything is fine, but I want to handle the navigation errors:
1- why I get errors for linked css and js file in the web page?
2- How to read only errors which come from the page itself like, 404 and others.
3- I want to hide the webview from the form and show friendly page if I cannot load the content of the page.
4- Is there a way to keep navigation events rais only for the source link, not for the linked css or js files?

Finally, I tried to tack all the errors, e.g. "FormswebView_OnNavigationError". but sometimes I get 404 error, while the page is correctly working fine because this 404 error was just for a linked file "css, js, images" in the pages only which not prevent the page from working. I want to handle, "no connection", "cannot load", "server busy", and all kind of errors that will prevent the user to see the content. All solutions should be work in cross-platform, please.

In brief, how to know if the page finally displayed or not?

Thanks in advance

Sorry, I am not a native english speaker.
I want just to know if my webpage is loaded or not.
I do not want the use to see any error pages.
I cannot count on "OnNavigationError" Event it is not usefull. It raised for some css, js errors, even if page is correctly loaded.
some times it raised 404 "not found" error for linked css, js files, and the webpage is loaded
I want to override all webview error pages.
I hope if I make it more clear
Regards