Discourse shows blank page when JavaScript is partially blocked

javascript

(_Vi) #1

I go to forum and see just a white page. Enabling JavaScript for this domain reveals a Discourse instance.

Better options are:

  1. Fully allowing participating without JavaScript (except of nice features);
  2. Showing just read-only basically formatted content (like for the search engines);
  3. Showing “This is a Discourse forum. It requires javascript.”-like message.

(Régis Hanol) #2

We already do a mix of all 3 techniques :wink: What browser are you using and how are you disabling JS?


(TechnoBear) #3

I have long had this issue, although it’s discourse.global.ssl.fastly.net that I have to enable, rather than the domain.

Currently Firefox 38 on Ubuntu Gnome 15.04, but it affected earlier versions of both browser and OS. I use NoScript to block JS, because then I can allow some scripts and block others, (rather than an all-or-nothing approach) which (hopefully) lets me enable stuff I need to use a site whilst still blocking anything which causes visual/perceptual problems.


(_Vi) #4

For example, https://forum.safenetwork.io/.

If I select “Forbid safenetwork.is” in NoScript and reload a page, I see just a while screen.

There are errors in console:

ReferenceError: PreloadStore is not defined
PreloadStore.store("site",{"default_archetype":"regular","notification_types":{"...

forum.s...work.io (line 212, col 8)ReferenceError: Ember is not defined
Ember.RSVP.configure('onerror', function(e) {

forum.s...work.io (line 234, col 2)ReferenceError: Discourse is not defined
Discourse.CDN = '';

I think Discourse should detect partially blocked JavaScript and show the approriate message and/or show no-JS variant of the page in this case.


(TechnoBear) #5

That’s strange. Without allowing safenetwork.io in NoScript, I see this:

Which is similar to what I see here or on SitePoint with JS disabled. The issue for me is if I enable JS for the domain, but don’t enable it for discourse.global.ssl.fastly.net (or sitepoint-discourse.global.ssl.fastly.net) I then get a blank page.


(_Vi) #6

I don’t see any references to fastly.net (in Firebug or NoScript). And “fastly.net” is in NoScript’s whitelist.


(Kane York) #7

This was fixed by one of my old PRs which got rejected:

https://github.com/discourse/discourse/pull/3105

Basically, it changed
<noscript>
into
<div id='noscript'>.....</div><script>var ns = document.getElementById('noscript'); ns.parentNode.removeChild(ns);</script>


(Jeff Atwood) #8

Step 1 – disable JavaScript in Firefox

Step 2 – visit meta.discourse.org

Premise of topic is 100% incorrect. I am editing the title. If you partically block JavaScript, that’s on you.


(_Vi) #9

I think common partial JavaScript cases (allowed the domain, disallowed everything else + allowed everything except of this domain) should also be handled.

It is tricky to enable just Discourse instance on the given site without enabled all other JavaScripts from this site.