Disabling unload-on-scroll?

AI-generated summary

The discussion addresses the desire to disable Discourse’s “unload-on-scroll” feature, which removes older posts from the DOM as users scroll down. JetForMe highlights that this behavior breaks the browser’s native page search (e.g., Command-F), forcing users to rely on Discourse’s slower internal search tool. codinghorror suggests using the “End” key to jump to the bottom, but ToyKeeper argues this is insufficient for their needs.

ToyKeeper explains that they previously used a workaround involving SingleFile to export entire topics as static HTML archives, allowing them to filter content using tools like uBlock Origin’s “zapper” and save specific sections without posting them. This ability was lost when Discourse enforced the unloading behavior. They propose a feature to temporarily disable unloading via a hotkey, acknowledging the increased memory usage but emphasizing the utility for archiving and deep-dive research in long threads.

Falco offers an alternative by suggesting the use of the /print route, which loads up to 1,000 posts in a JavaScript-less view. However, ToyKeeper notes this does not fully replicate the interactive, editable, and filterable experience of having the full DOM loaded in the browser tab.

Is there any way keep older posts loaded on the page as one scrolls down a topic? It breaks using the brower’s built-in page search functionality, which is less clunky to use than Discourse’s topic search. Anywhere on the page I can just hit Command-F and enter some text, and then quickly search through the text as rendered to find occurrences. Discourse’s search requires me to scroll to the top, click the search icon, check the “this topic” box, and then click the results to see their context. Each time I want to try another result, I have to repeat that.

Ideally it would load the whole thread, rather than requiring me to scroll to the bottom, but I get why it doesn’t do that, and at least I can scroll to the bottom quickly with the keyboard to load more. This would be fine, except it discards previous posts as I go, making those impossible to search.

Press the end key on your keyboard, or click / tap on the date at the bottom of the timeline. You can also enter a topic at the bottom by clicking on the last post time or the post count.

There is a special route for printing that you can use for this, like

https://meta.discourse.org/t/the-state-of-javascript-on-android-in-2015-is-poor/33889/print

(need to open in a new tab). This will load up to 1000 posts, in a JS less view.

5 Likes

The “print” route is a good start, but still not really what I was looking for.

In older versions, I could scroll to load an entire topic (or just the section which is relevant to a particular sequence), and keep it loaded, then use SingleFile to export an archive of the entire topic, displayed exactly as-is, as a regular forum page. Similar to a screenshot, but smaller, scrollable, zoomable, clickable links, save-able images, and text represented as text instead of pixels. Could also prepare the page first, doing things like expanding the “3 replies” widget, or un-hiding spoilers, or even attach private notes in the reply widget, to be viewed as part of the archive but never actually posted to the forum. Could also use uBlock Origin’s “zapper” to remove posts which aren’t relevant to the part of the topic I wanted to save… trimming the discussion down to just the exact comments I need.

Then during a Discouse update, this ability was lost. The most I can get is a few posts at a time. Maybe more if I zoom out as far as the browser allows, to fit more posts onscreen.

Would be awesome if there was a way to force it to stop unloading posts. Like, a hotkey or a button or a Konami code, or … whatever. Just press something to temporarily disable the javascript function responsible for unloading off-screen posts, for only this browser tab.

For example, let’s say there is a 12,000 comment long topic about a group buy, spanning years, and then in the middle of it, people chat about cats for 100 posts before going back to the original topic. I could scroll to the beginning of the cat thread, press a “stop unloading posts” hotkey in Discourse, scroll down, use uBlock’s zapper to remove any posts which aren’t about cats, scroll to the end of the cat thread, then press the SingleFile hotkey to save the DOM as a .html file.

I was able to do this as recently as last year; not sure when it stopped. Maybe it was only a bug which allowed it to work, since it looks like the unloading behavior already existed a decade ago. But I liked that bug, and would like to be able to bring it back sometimes.

I know it would make the tab use a lot more resources. That’s fine. There are use cases where “more content loaded in the DOM” is more important than minimizing RAM use.