[Bug] Search results are displayed before the blacklist is applied.

In category: Site Bug Reports & Feature Requests

I apologize if a feature request would be more in order. This issue has been around for a while, and I'd be happy to see it fixed.

Bug overview description.
When searching, there's a brief window of time in which all potential search results are displayed. A moment later, the user-side blacklist runs, and yanks any offending candidates out. This can give a momentary glimpse of unwanted or offensive content to those not expecting it, such as gore, blood, death, and slightly_chubby. ;;)

What part(s) of the site page(s) are affected?
The Javascript that handles blacklisting results

What is the expected behavior?
The search engine completely prevents blacklisted images from appearing to the user, for any period of time.

What actual behavior is given instead?
For a moment (approximately 300ms in my case) all posts are displayed without any filtering applied, including the gory and explicit.

Can you reproduce the bug every time?
Yeperooni.

What steps did you take to replicate this bug?
Perform a search for any tag you have blacklisted. Sort by score_asc if you're feeling brave. Images with the blacklisted tag will briefly flash on the screen before disappearing, just enough time for a cheese grater or two to be permanently seared into the mind's eye.


Old news. Blacklists are handled clientside to prevent strain on the server, so the server sends the images and then the client removes the ones that contain the bit that was blacklisted.


Furrin_Gok said:
Old news.

I'm well aware. The solution could also be implemented client-side, with a little Javascript tossed into the blacklist functions to the extent of "hey, I'm still working on this, don't display it until I'm done".

Of course, this could result in a small increase in load-times on searches that aren't heavily effected by the blacklist. A faster method for blacklisting (i.e. storing the list as a cookie rather than making a get request every time) could help with that. It's generally bad for accessibility when a page's contents rapidly change as it's loading, and accidentally showing people gore when they specifically told you not to is REALLY bad for accessibility.


such as gore, blood, death, and slightly_chubby.

One of those is not the same.


Doomguy666 said:
One of those is not the same.

Whenever I see slightly_chubby stuff I throw up and can't sleep for a week.
*shudders*
[/sarcasm]


Doomguy666 said:
One of those is not the same.

I feel like this was a jab at how frequently freshly-posted slightly_chubby posts vastly exceed the allowable standards of the tag.


Doomguy666 said:
One of those is not the same.

Murder, arson, and jaywalking.


MissChu said:
Murder, arson, and jaywalking.

jaywalking needs a trigger warning


I've wanted to fix this for a long time but there are major concerns that if I mess it up just slightly, people will complain and get very pissy about it, so we have decided against touching the blacklist code entirely.


I have an idea. For users with JavaScript enabled AND text in their blacklist, we hide all results, and then show them when everything is loaded and blacklisted items are hidden.

Oh wait, that was your idea.

I will look into it and post the code here if it works.


Try this userscript:

// ==UserScript==
// @name         Hide Thumbnails
// @namespace    http://tampermonkey.net/
// @version      0.1
// @match        https://e621.net/post/index*
// @run-at       document-start
// @grant        GM_addStyle
// ==/UserScript==
(function() {
        'use strict';
	if (window.location.href.search(/https?\:\/\/e621\.net\/post\/index/)==-1)
        {
		return;
	}
	GM_addStyle ( `.content-post {visibility:hidden !important;}` );
	document.addEventListener ("DOMContentLoaded", DOM_ContentReady);
	function DOM_ContentReady ()
	{
		document.getElementsByClassName("content-post")[0].setAttribute("style","visibility:visible !important;");
	}
})();

Lance_Armstrong said:
Try this userscript:

The window.location.href.search() was causing an error for me, but after removing it, works like a dream! Excellent job.

If you don't mind, here's the edit that worked for me.

// ==UserScript==
// @name         e6 Hide Thumbnails
// @author       Lance Armstrong
// @version      0.2
// @match        https://e621.net/post/index*
// @match        https://e926.net/post/index*
// @run-at       document-start
// @grant        GM_addStyle
// ==/UserScript==
(function() {
  'use strict';
  GM_addStyle (".content-post {visibility:hidden !important;}");
  document.addEventListener ("DOMContentLoaded", DOM_ContentReady);
  function DOM_ContentReady () {
    document.getElementsByClassName("content-post")[0].setAttribute("style","visibility:visible !important;");
  }
})();

e621 killed my backslashes. I just fixed it above. But it is redundant anyway.