• Feedback
  • Both Discourse and Flarum don't work with blocked javascript, can we fix it?

It's really a pity that both Discourse and Flarum don't work with blocked javascript. I think that nowadays many privacy-conscious people do block javascript (that if not to mention all the other perks that come with disabling JS, like saving bandwidth). Is there any chance for Flarum to be the first one to offer this feature? Thanks a lot

    The first one? No, forums that work without javascript are already out there, and there are some excellent choices if you are someone catering to the crowd that prefers not to use javascript. I know SMF and phpBB work pretty well without javascript, there may be others still.

    Will Flarum do this? No. Javascript lies at the very core, no pun intended, of Flarum's design. It's taken cues from many modern web applications, where javascript is a first class citizen. If Flarum were to make this accommodation, it would require a complete rewrite of the software, and that's really not the intention.

    Use the right tool for the right job. If Flarum isn't the right tool for you, that's okay. It's not going to work without javascript, so if that's your needs, I recommend looking at other forum software.

      Are you talking about a noscript read-only mode ?

      Rendering the client-side app in the backend should definitely be possible, even an extension should be able to add that. Most of the navigation should be able to work without javascript but with every page rendered server-side. The problem is what do you do with anything that's rendered but actually non-functional...

      Or alternatively, a different, HTML-only rendering for this case. That's what Flarum already includes.

      However I don't see a noscript read/write version as a possibility. Flarum relies too heavily on API requests. There would need to be an HTTP form version of every endpoint. And that's without counting the numerous extensions that likely won't work correctly without JS. I don't think we can force a noscript standard in extensions, we'd get way too limited in extensibility.

      I suppose a lightweight read/write html version of Flarum would be possible, but as an extension, keeping only the required features in the HTML version and optimizing them for standard HTML form submission. But at that point it's kind of like rewriting from scratch, keeping only the database schema and maybe proxying through the API locally. Almost a second forum software.

        just-do-it There is almost no modern web app, that works properly without JavaScript...
        Seriously, blocking Javascript is not for privacy-contious people, but for those, who has no idea how web apps works, and wants to be fancy. There are many ways of taking care about privacy (eg. blocking cookies on any not trusted webside, using privacy mode on browser, using VPN etc.), but not blocking JS. It plays crucial role in modern web apps, and not using it is like going back to medieval days...🙂

          jordanjay29 I meant the first modern one, in any case thanks for the reply. I think I will just have to wait for some other projects to appear that'd do that. ❤️
          @clarkwinkelmann I see, thanks for the explanation.
          @Staszek There is GitLab, reddit, github and perhaps many more modern websites that work great without JS.

            just-do-it There is GitLab, reddit, github and perhaps many more modern websites that work great without JS.

            Err, I would have to (politely) disagree with you there. Reddit, I'm not sure about, but both GitHub and GitLab do utilize some JavaScript. JavaScript is required in GitHub to view repository commits and such, and to edit files. GitLab requires it to view & render files. Without JavaScript, you'd be able to browse files and such, but you wouldn't be able to do much else. The point is, JavaScript is used at least a little bit in most websites and some are completely JavaScript, so having JavaScript enabled in your browser is absolutely necessary. As Staszek pointed out, there are alternatives to just disabling JavaScript. There are ad blockers that restrict JavaScript that actually does track you.

            @OrdinaryJellyfish @luceos Yes they do use JS but I'm at least able to read and navigate through their websites. That's like the basic minimum, and then some allow you to do more stuff like sign in, open issues, comment and so on. I mean there is a reason why LibreJS, NoScript etc.. exist. Btw LibreJS got $100,000 in funding this year 🤠

              Reddit and GitHub works pretty fine without JS. Many features are unavailable, but website looks the same and for quick reading something it is enough. Flarum looks completely different and you're not able to read thread, because there is no button to switch page... Obviously it is impossible to make Flarum JS-free, but still there is much room for improvement and GitHub could be an example here how it could be done.

              All of the examples listed (Github, Gitlab, Reddit) were developed in the days when javascript was considered an addon to websites, even if it was used to enhance sites from being Web 1.0ish to Web 2.0. We're approaching Web 3.0, and part of that is moving away from old paradigms, including javascript as optional or only marginally necessary.

              Many modern web apps are developed with javascript at the forefront. This is pretty much an unavoidable fact of the web now. If your aim is to enhance privacy and avoid tracking scripts, there are tools like Privacy Badger and such that assist with that, without breaking websites.

              If your aim is simply that javascript is bad, then Flarum really isn't the software for you.

                jordanjay29 Your attitude reminds me times when flash-only websites were on top. 😃 You don't need a bunch of JS to display list of posts with proper formatting and "next page" link, same as you don't need a flash widget to display navigation. Things like accessibility matters regardless what number you put in "Web X.0".

                  @just-do-it In addition to what @jordanjay29 wrote, I would add, that you actually save bandwidth when using Javacript in modern app. They are built in a way, that you only download templates once, and then just data that will fill this templates. And when you want to for example refresh discussions list in Flarum, you only download data, not information about how it is styled. And yes, sometimes there are requests for info about new posts, but this are so small requests, that you don't even notice it. In case of Flarum it is done in Pusher, that uses websocket, so you only get data when there are new posts.

                  rob006 accessibility

                  If there's a real problem with accessibility due to the way Flarum is designed, we would absolutely like to hear it. That is, accessibility for those with a disability due to unchangeable circumstances.

                  Yes, I recognize that there are users out there with a preference not to use javascript. That's absolutely fine. And I also recognize that Flarum isn't built with that in mind, and making it so (as clarkwinkelmann explained) would be extensive and require almost a complete rewrite, so I recommend using a different forum software.

                  Use the right tool for the right job. Don't get mad at the screwdriver that it can't do what a hammer does.

                    jordanjay29 If there's a real problem with accessibility due to the way Flarum is designed, we would absolutely like to hear it. That is, accessibility for those with a disability due to unchangeable circumstances.

                    Screen readers does not work well with SPA and dynamically loaded content may be a problem for them. It will be much less problematic with usable non-JS version with actual navigation.

                    jordanjay29 would be extensive and require almost a complete rewrite

                    Sorry, but it is hard to believe. Flarum already renders content for non-js browsers (and even styles it), all you need is to improve how it looks and add some "next page" button to this:

                    There is even a GitHub issue which mentions this: flarum/core1643 - definitely does not look impossible. 😉

                      I actually don't like all of this "Face it, the web doesn't work without JS" stuff. There is good reason not to use JS everywhere, from energy consumption to bandwidth (yes, megabytes of initial JS take a while to be offset by relatively small subsequent AJAX requests) and performance. And using client-side rendering for text-heavy sites like blogs... well, don't get me started.

                      That said, forums like Flarum are mostly aiming at the interaction aspect rather than the wall-of-text part. We made the decision early on to build this as a single-page application, and that won't change. (Building accessible SPAs takes more work, but is possible.) I can absolutely see that there is room for other software to fill this space. (In fact, I plan to keep FluxBB alive in a sort of maintenance mode, focusing on architecture, performance, security and low resource usage, with JS being completely optional - so maybe that is something for you.)

                      rob006 Flarum already renders content for non-js browsers (and even styles it), all you need is to improve how it looks and add some "next page" button to this:

                      If you're interested, we're 100% open to improving the no-JS experience, but currently have other priorities on the immediate roadmap (in order to get the stable release out). We'd love for you to send pull requests or other proposals with improvements in this area. 🙂

                        Before I continue - this discussion seems to be offtopic, so if you think that we should move to another thread, then maybe it's a good idea. But I think we can continue here, because original topic seems to be finished - OP has his answer. You decide.
                        Secondly - I would like to continue, because I see an opportunity to learn something new. So I will try to give you some arguments, and I'm open for counterargument.

                        Franz I like this kind of discussions, where we can use numbers. I did some calculations for this particular discussion page.
                        It turns out, that you are right - there is 210,14 KB of JS (but actually no megabytes) to be downloaded (after compression) plus 13,88KB of HTML, plus marginally 678B of JSON to be downloaded, after scrolling for more posts.
                        I saved this whole page as HTML document, and it is 144,5 KB big, so it is smaller. And probably would go down to about 40KB after compression. I don't count CSS files, and images, because it has to be downloaded anyway.
                        But - most of JS is the same for all requests, so it has to be downloaded only once, and then it is cached. If I have cache turned on in my browser, then JS file's size goes down to 26,8KB, and this is smaller than downloading whole page every time. And from there one, if I load another thread I just have to download JSON data that is usually less than 1KB.
                        I would be happy to see some comparison for energy consumption, but I have a feeling, that it would be marginal for page like Flarum.
                        As I already mentioned, privacy is not the reason for not using JS, because one can do many other thing to avoid being tracked, and at the same time use advantages of JS.
                        The only real reason to turn it off that I know, is to avoid malicious JS, like cryptocurrency mines on ads, or exploits of Meltdown/Spectre holes.

                        just-do-it As of LibreJS - rationale for it is described in this article by Richard Stallman: http://www.gnu.org/philosophy/javascript-trap.html. In short - he doesn't like when any non free code runs on his PC. And non free means that he doesn't know what is does, and cannot change it. GNU wants software to be free as in freedom, so that everyone who wants, can see the code, and have freedom to change it. LibreJS will give opportunity to detect and block any non free and non trivial JS (non trivial meens in short - any JS that does something meaningful, so for example decoration seems to be allowed). Maybe in the future it will give the opportunity to easily change JS from the webside to your version.
                        So Richard Stallman is NOT against JS in general, but only non free ones. But Flarum is free software, both as in freedom, and as free beer. With proper marking in Flarum's JS code LibreJS would not block it, because it's free (as in freedom). Actually, maybe it's a good idea to add this marking, as described here?

                        Concluding - I think that there is no reason to block JS by default on every page, especially when you can trust it. That is the case of Flarum, because it's free. JS gives web much more opportunities in functionality, and saves bandwidth, so it's worth to be used.

                        As I already wrote, I'm open for counterarguments, to maybe learn something new (as I already did by reading about LibreJS and free JS).

                          Staszek Bandwidth is irrelevant here - HTML of this thread, after compression, takes about 16kB. This is a size of one avatar. Even if you reduce HTML weight by 80% because you're using SPA and JSON API to load data, it still does not matter, because HTML is a tiny fraction of bandwidth used by modern websites. And it is irrelevant event more if non-JS version will be used only as a fallback, and most of users will use JS and SPA version.

                          Staszek Concluding - I think that there is no reason to block JS by default on every page, especially when you can trust it.

                          The point is situation, when you don't trust it, because your seeing it first time. As a forum owner you only have one chance to make a first impression, and you don't want to show broken website only because someone has disabled JS (or has slow bandwidth/device, and he needs to wait to load and execute all JS to make website look as it should).

                            rob006 and you don't want to show broken website only because someone has disabled JS (or has slow bandwidth/device, and he needs to wait to load and execute all JS to make website look as it should).

                            I set my developer tools to "poor 3G" to see if this was a real concern, what I found is so long as the web server is using good GZIP compression then this isn't really an issue, the post themselves will at least load and they can at least see the content. All modern websites use massive amounts of JS, I see no reason that forums should be any different. It is time for us to continue on. If theirs a particular use case for no JS forums (tor, privacy concerned site owners, etc) then PHPBB is the way to go and already exist. Flarum looks and acts as awesome as it does because it has so much JS, without the JS forum is basically just a reimagined PHPBB.

                              tankerkiller125 If theirs a particular use case for no JS forums

                              I'm not talking about non-JS forum. I'm talking about sane non-JS fallback which allows you to read and navigate trough forum without impression that it is seriously broken. You don't need to resign from SPA approach to achieve that, some basics already exists.

                              3 months later

                              I talked with friend about this, he'll be back in about 30 days so we will start to work on this. We already work on one more open-source forum (vanilla), but I want to try with flarum as our second project. Vanilla also use javascript, but it's possible to use forum without. I can't talk about flarum as I still didn't installed, but if you guys continue working on this, we can continue on creating flarum work with tor browser. It need a lot of coding, but not impossible. I am still learning and I am not professional, but 2 friends that work with me are more then good. My main job is design, but I learned a lot of coding so I want to continue. I hope we have more people who want to help to make flarum work with noscript, at least for normal reading and posting. Have a nice day all!