Reddit New Comment Highlighting

A free Gold feature

< Commentaires sur Reddit New Comment Highlighting

Avis: OK - le script fonctionne, mais souffre de quelques problèmes

§
Posté le: 2022-04-29

stopped working on FF

§
Posté le: 2024-03-24

It works for me if i change from JQuery to Javascript in the highlight function, like this:

HLN.highlight = function(cutoff) {
    var items = document.getElementsByClassName('entry')
    Array.from(items).forEach(function(element) {
    var time = element.querySelectorAll('time')[0]
        var date = new Date(time.getAttribute('datetime')).getTime();
        if (date > cutoff) {
            element.classList.add('new-comment');
        } else {
            element.classList.remove('new-comment');
        }
    });
};

Poster une réponse

Connectez-vous pour poster une réponse.

长期地址
遇到问题?请前往 GitHub 提 Issues。