Custom Webview Error Pages

webviewer
question

#1

I need to know how to make custom pages for the following errors:
net::ERR_NAME_NOT_RESOLVED
net::ERR_INTERNET_DISCONECTED

That is all I could remember I will add more as I go. Thanks!


#2

Well you cannot make directly that with Thunkable. You need to program a webpage by yourself with HTML. Afterwards, set WebViewer url to data:text.html, your html code


#3

Yeah, but how to detect the error??

I might be able to send GET requests to do it… Only a theory


#4

There is a plenty of topics for that, use search bar.


#5

Ok, I saw that earlier, just not the internet part. So now I know how to do internet one, what about name not resolved. Could I do this with a GET?


#6

What you are trying to achieve? GET is an http request type, used for getting data from server.


#7

Trying to detect wether a domain has DNS or not. Exactly, so if there is no server an error must be reported through the GET right?


#8

@Csf30816 Also, try to change getResponseContent to getResponseCode & then Replace this after… to 404 :thumbsup:


#9

That is exactly what I am thinking :smile:
@ILoveThunkable Cool thanks. I will do this in the morning.


#10

You’re making a good point but your explanations are not understandable. You can make it more clear pls!


#11
when ExtendedWebViewerExtension.OnLoadingFinished do:
  call WebComponent.Get(text: "")
done

when WebComponent.GotText do:
  if (responseCode = errorNumber):
    call WebViewerComponent.GoToUrl(url: "data:text/html,codeGoesHere")
done

Note: to learn more about HTTP status codes look at https://en.wikipedia.org/wiki/List_of_HTTP_status_codes, to learn more about HTML language take a look at https://www.w3schools.com/html/default.asp and to find ExtendedWebViewer extension take a look at [Free] Extended Web Viewer Extension


#12

Cool dude! Let’s figure it out!


#13

WebView Custom Error Page | AIA File | Thunkable | Appybuilder | Makeroid

.
.
Project AIA FIle - Download