[Solved]Test internet connection


Why this doesn’t work?

var connect;
if (navigator.onLine) {
  connect =1;
} else {

Maybe something like (obviously something that work!) this must be added on AdMob instruction page.

Thanks in advance!

It does work. Why do you want to do that, there is already an extension for this by discord user Anitta. Look at the extension repository to find it.

Thanks! Really? It give me all time 0 even if connected. You know why?

Never found this extension (I found your reply on old message that send to Maury in GitLab, but no other extensions doing this in GitHub).

:thinking: It is on the github tho. Do you console.log it to find the value of it or what do you do exactly to find it’s value?

Thanks, this was what I found on your previous reply on this topic. I never used because still nub and would like to understand. Indeed I will try.

Just show value of variable by globalvariablestring(var).

JavaScript local variables are not the same as GDevelop global variables. To set a JavaScript variable to a global variable, you need to use


To access your variable like you did.

Have to understand. Just prepared an html file with MauryDev js file and inspecting with console seems it/you send a number and have back the same number (but also offline). Still not clear the lines but I will arrive.

Now if I put on Gdev where I can put on lines a variable to have a answer after the test?

Thanks for the fast reply. Let me try!

Did it! My small system work perfectly with your addition!
Many thanks again!

1 Like