Forem: It says "no internet" with disabled JS

Created on 26 Feb 2018  路  22Comments  路  Source: forem/forem

Current Behavior

The website (with the fabulous service workers) says me that I don't have an internet connection when I only have Javascript disabled.

Expected Behavior

I'd expect the site to work normaly with disabled JS because it's just an article and HTML could do that 25
years ago when no Javascript existed :P

Additional Info (steps to replicate, device/browser, helpful links)

My browser is Firefox (58) with uBlock installed (that plugin does the JS blockation)

Screenshots

image

ready for dev bug

Most helpful comment

Hey @CodeMouse92 and @exyi (in case you're still having issues with this), it might be related to Privacy Badger if you have that installed. We had this issue: https://github.com/thepracticaldev/dev.to/issues/456 and I guess it's a bug on Privacy Badger's end.

All 22 comments

Hey @exyi, thanks for the heads up. We'll take a look into this bug.

If you loaded the site with JavaScript enabled (which registered the ServiceWorker) and then disabled JS in Firefox then this is why you got the no internet.

  • Disabling JS only disables page execution. the service worker still runs in this instance. this may be a firefox bug or the expected behavior, I would check with Chrome and Edge
  • why you got the offline page instead of the app shell I'm not 100% sure

I'd expect the site to work normaly with disabled JS because it's just an article and HTML could do that 25 years ago when no Javascript existed

modern websites use JavaScript and JS is even engrained into the HTML spec. disabling JS and expecting the modern web to still work is not a valid assumption in today's age. a lot has changed into those 25 years

I think this is likely related to #128. If Firefox is still running the SW when JS is disabled, that feels like a FF bug. I wonder what the behaviour is like in Chrome.

I disagree that you should not be able to expect a website that is primarily made of text and images, particularly a publishing platform like Dev.to, to work without JS. I also believe that the Dev.to team have worked hard to make the JavaScript in the site unobtrusive, so I would expect it to work. In fact, I just turned JS off to check and the core of the site, reading, writing and publishing posts, works.

@exyi as the others have mentioned, I think you could try viewing the page without JS by turning off service workers. On Firefox, you can follow these steps:

  1. Visit dev.to and clear the entire cache storage
    Open a new tab and go to about:debugging#workers
  2. Unregister any service workers you have related to dev.to (should be just one)
  3. Turn off JS, if you haven't done so already
  4. Visit dev.to again, which should now work without hitting the offline page

That should work as a short term solution.

Hi, you're right, when the service worker is not registered the page works well (I tried in private mode, FYI). As a short-term solution, I can enable the JS, it's two clicks with uBlock ;)

Yeah, I get this problem too, on both Chrome and Firefox. I have to Ctrl+F5 to force cache refresh to see the site, just about every time I open it in a new tab/window.

I'll try disabling uBlock Origin on dev.to, and see if that resolves it.

Hey @CodeMouse92 and @exyi (in case you're still having issues with this), it might be related to Privacy Badger if you have that installed. We had this issue: https://github.com/thepracticaldev/dev.to/issues/456 and I guess it's a bug on Privacy Badger's end.

@Zhao-Andy I do indeed have PrivacyBadger. I'll leave that _on_ and uBlock Origin off for now, and report back if the problem persists.

@Zhao-Andy No dice! Even with both disabled, as soon as I restart Firefox, I get the "offline" page.

@CodeMouse92 Ah bummer. :( Maybe try disabling service workers for dev.to with these steps:

  1. Visit dev.to and clear the entire cache storage
  2. Open a new tab and go to about:debugging#workers
  3. Unregister any service workers you have related to dev.to (should be just one)
  4. Visit dev.to again

@Zhao-Andy As soon as I unregister it and refresh dev.to, I get another one.

@CodeMouse92 Ah duh,my bad. Those steps only work if you're disabling Javascript too. If you're okay with it, you can disable service workers for the whole browser. Note that this disables service workers on all websites.

Firefox:

  1. Visit about:config
  2. Search for: serviceworkers.enabled
  3. Toggle it from true to false. There's also a serviceworkers.testing.enabled setting, which is unrelated.

I couldn't find a way to disable service workers completely for Chrome.

Yeah, I don't want to disable for all.

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue in 7 days. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If this issue still requires attention, please respond with a comment. Happy Coding!

Oh yes, it's still an ongoing problem! :(

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue in 7 days. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If this issue still requires attention, please respond with a comment. Happy Coding!

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue in 7 days. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If this issue still requires attention, please respond with a comment. Happy Coding!

No, it's still a problem. Do you want me to write a bot to post spam comments here just not get the issue closed? If someone would resolve the problem, maybe they'd close the issue, I don't really understand this logic "maybe it will fix itself..."

This is also an issue if I disable cookies e.g. using Privacy Badger.

disabling JS and expecting the modern web to still work is not a valid assumption in today's age.

The site currently fails or behaves in unexpected ways across the board if your browser or privacy settings block one js source or another, or if the js dependency is not met due to CDN connectivity issues. I think it's a valid bug.

@rhymes I believe this is no longer and issue

It is still an issue. To replicate, go to dev.to, install uMatrix and disable scripts, go to dev.to and the following screen instead of the article:

image

@exyi that's a shame it works in chrome with JS turned off.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Gbahdeyboh picture Gbahdeyboh  路  43Comments

Defman21 picture Defman21  路  29Comments

omenking picture omenking  路  30Comments

lightalloy picture lightalloy  路  22Comments

richardeschloss picture richardeschloss  路  24Comments