Ability to disable auto-update on the forum main page


(Mason Gup) #1

I’d be interested in a feature to disable the auto-update on the main page - the feature where the topic list page will periodically check for new activity and, if found, add an update count to the page title and a bar at the top of the topic list reading “x or new updated topics. Click to show”. I suppose a checkbox in the settings, enabled by default, that could be disabled to stop the behavior.

I have some experience in Rails and JS development, and I’m willing to write it myself if the Discourse team would be open to a pull request.

Personally, I find it distracting to my usual forum workflow. I like to keep a forum main page open in a tab while I work, with a couple of topics that sound interesting open in other tabs, and periodically check on them. If the forum has any decent activity level, then the update counter is constantly updating and beckoning me to check/refresh it again. I’d like to be able to have it remain static until I explicitly refresh the page.


(Sam Saffron) #2

Odd request, but just disable it in CSS if you wish. Its a trivial site customization.


(Mason Gup) #3

A userscript updating CSS could hide the bar at the top of the topic list easily enough, but what about the number in the document title?


(cpradio) #4

The Tab Title, it is already a setting in your user preference


(Mason Gup) #5

Maybe I’m missing something, but I don’t see an option for that anywhere?


(cpradio) #6

Fairly certain this affects the Title too… but I might be mistaken.


(Mason Gup) #7

Nope. I saw that option, and I already have it off, but it doesn’t affect the title:


(Mason Gup) #8

Whelp, I wrote a UserScript for Chrome Tampermonkey that does what I’m looking for, incase anyone’s interested:

// ==UserScript==
// @name         Block Discourse title updates
// @match        https://meta.discourse.org/*
// @grant	 unsafeWindow
// ==/UserScript==

_.each(
    _.filter(unsafeWindow.MessageBus.callbacks, 
          function(i) { return i.channel === '/latest' || i.channel === '/new'; }), 
    function(i) { unsafeWindow.MessageBus.unsubscribe(i.channel, i.func) });

(Sam Saffron) #9

Note, this will break the “2 new or updated topics” notification you get in the topic list.


(Mason Gup) #10

Yeah, that’s intended. I find that really annoying on even a medium-traffic forum - you can’t look at the main page for 10 seconds without a notification that there’s new activity.

It seems to need a little update too - the script wasn’t seeing lodash right or something, so I switched it to use just basic Javascript.

// ==UserScript==
// @name         Block Discourse title updates
// @match        https://meta.discourse.org/*
// @grant	 unsafeWindow
// ==/UserScript==

(function () {
    'use strict';
    var bus = unsafeWindow.MessageBus,
        i,
        thisCall;
    for (i = 0; i < bus.callbacks.length; i += 1) {
        thisCall = bus.callbacks[i];
        if (thisCall.channel === '/latest' || thisCall.channel === '/new') {
            bus.unsubscribe(thisCall.channel, thisCall.func);
        }
    }
}());