Disable images in signatures

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Disable images in signatures

Re: Disable images in signatures

Post by joedf » 27 Mar 2019, 22:50

Thanks for sharing :+1:

Disable images in signatures

Post by lvalkov » 27 Mar 2019, 19:56

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'
})();

Top