Forums Load Even When There Is No Internet

  1. What browsers show this problem?
    Chrome, Microsoft Edge & maybe others, too
  2. Please share an example project (if possible).
  3. Describes the steps to reproduce this issue.
    Turn ff your Wi-Fi or data, and visit Snap! Forums
  4. What does Snap! currently do?
    Shows the forums
  5. What should Snap! do instead?
    Should not load
    Here's a picture:
    However, the forum does not load. It just sets itself to how it was the last time I visited. This happens both on my PC and my mobile.

That would be pretty magic if true!

I imagine what's happening is that your browser is caching (saving) the forum page, and when you try to connect to the forum with no Internet it's just showing you the cached page. Look in your browser settings for something like "Clear browsing data" (in Chrome it's in Advanced > Privacy and Security). Clear the cache and try again.

No! Not at all! I hate that thing! That is disabled on every browser I use.

Okay, I will...

Which one? I cleared browsing history, but the same thing happened.

Okay, I give up. But if you're not connected to the net, it can't be loading the forum.

... Oh, wait. Are you on a smartphone? If so, turning off wifi doesn't get you off the Internet; you're just using a cellular connection instead. Try turning on airplane mode and then try.

Forum software uses "Service Worker" and store data for offline use in Storage>IndexedDB.
Visible in Chrome Debuger, Application tab.

Obviously, not.
@dardoro, I don't use that.



If I understand correctly, @dardoro is not saying that you are using it intentionally, I guess, but that your browser does without letting you know that it does? Do I understand correctly, @dardoro ?

Yes, "service workers" are part of Web standard and enabled by default in current browsers.
Even required for "instalable web app" future.

Oh! I am sorry.

Do you know how to disable that?

What you mean by the Chrome Debuger, I guess, is now named "Developer Tools", which is itself a menu item in the "More Tools", right?

(I have no idea how to disable it, though.)

URL: about:config
Entry: dom.serviceWorkers.enabled = false

I am confused. Is that how you do it on Firefox? If yes, that is not what I am looking for. I use Chrome and Edge.

Consider it as hint/keyword for gathering exact information.
Google "Firefox about:config" returned link to detailed article

After searching for "Chrome disable Service Workers" you may found e.g.!topic/service-worker-discuss/Cohd-TKG8so


Thank you. I will be doing that soon. @bh, interested?

Yeah. I didn't realize the forum was so proactive. @dardoro, am I understanding that this feature allows sites to run arbitrary code in the browser? Because Jens tells me that they're worried about eval as a security hole and may disable it, and this sounds similar. (The "they" in the previous sentence is the mysterious They who are in charge of things, as in "they should fix this pothole.")

It’s not arbitrary code — I mean any more than the rest of JS. It’s background caching, mostly. Similar to the old offline mode we tried to have that never worked very well. But the tech is more stable more.

What I'm asking is, will we be able to use it to implement JS Function when Google outlaws eval().

They’re not killing eval. I don’t get where this keeps coming from. They cannot do that. It would break too many sites.