Page 1 of 1

Disable images in signatures

Posted: 27 Mar 2019, 19:56
by lvalkov
Some people have taken it upon themselves to attempt to enforce forum policies(?) by including obnoxious images in their forum signatures. While I can only assume this was done in good faith, the implementation is lacking and positively disruptive to the casual browsing experience. I can do just fine without the sporadic reminders to "enclose code in code tags", considering I am nowhere even close to submitting code (or submitting anything, for that matter) in the first place.

Unfortunately, no native facilities have been provided to disable the rendering of images in signatures, it seems. Of course, one could always disable signatures altogether or outright block offending users. Those are rather drastic measures, not without their drawbacks. I am currently running a userscript to get rid of the images, though I would have liked it if it was supported natively.

The script, for anyone else interested:

Code: Select all

// ==UserScript==
// @name         AHK Delete Images from Signatures
// @match        https://www.autohotkey.com/boards/*
// ==/UserScript==

(function() {
    'use strict';

    let Signatures = document.querySelectorAll('div.signature')
    Signatures.forEach(Sig => Array.from(Sig.children)
                                   .filter(e => /img|br/i.test(e.tagName))
                                   .forEach(e => e.remove()))

    let Post = Signatures.parentNode
    while(!/inner/i.test((Post = Post.parentNode).className)) {}
    Post.firstElementChild.style.minHeight = '100px'
})();

Re: Disable images in signatures

Posted: 27 Mar 2019, 22:50
by joedf
Thanks for sharing :+1: