Ask coding questions

← Back to all posts
How does Replit still have a page when I'm offline
codingjlu (481)

How did replit do this @amasad

Picture:

Answered by amasad (3536) [earned 5 cycles]
View Answer
Comments
hotnewtop
amasad (3536)

There is a browser API that detects when you're offline and fires an event. https://developer.mozilla.org/en-US/docs/Web/API/NavigatorOnLine/Online_and_offline_events

codingjlu (481)

@amasad cool, but usually if a page is offline it doesn't even load. How did you get a page to load, and how did you manage to save that code on my browser?

codingjlu (481)

@amasad I just awarded the CEO of Replit 5 cycles 😂

OldWizard209 (1608)

Wow, I am actually surprised he replied to your ping, even though he is busy af and probably gets a hundred pings in a day..... @codingjlu

codingjlu (481)

@OldWizard209 he replied like 4 minutes after I posted

ch1ck3n (2335)

@codingjlu he is a lurker of repl talk ask section like I am

InvisibleOne (3206)

I believe that the browser saves it.

codingjlu (481)

@InvisibleOne what kind of hack do they use here? How do they do it?