QUOTE(Striborg @ May 22 2019, 21:51)

Couldn't that be solved by giving users a small amount of blacklisting slots, with them being upgradeable like favorites?
The favorite exclusion search was removed
because it was resource-intensive (and hardly used), and I think a blacklist filter would not be possible for the same reason. A second-stage blacklist filter might be easier though.
QUOTE(Striborg @ May 22 2019, 21:51)

Thank you, though having to pollute my favorites page with galleries I hate isn't ideal.
Ok, I upgraded it a little to avoid polluting the full list of favorites, where galleries from all favorite categories are shown together. Now it will only show the blacklisted galleries when you select the blacklisted category on the favorites page. Note that if you have too many blacklisted galleries, then the full list will become a lot shorter and browsing can be less efficient.
CODE
// ==UserScript==
// @name EH Favorite-based Gallery Blacklist
// @namespace https://github.com/rraven314
// @description Excludes all galleries that belong to a blacklisted favorite category from gallery lists.
// @author rraven314
// @run-at document-start
// @include https://e-hentai.org/*
// @version 1.0.1
// ==/UserScript==
const BLACKLISTED_FAVORITE_CATEGORY = 'Blacklist';
let onLoad = function() {
hideBlacklistedFavorites();
};
let hideBlacklistedFavorites = function() {
// Excludes all galleries that belong to a blacklisted favorite category from gallery lists.
// This function securely hides individual galleries since favorites apply to gallery chains and are not affected by
// updates and title changes. The blacklisted category is specified by the constant BLACKLISTED_FAVORITE_CATEGORY.
if (document.querySelector('#dms > div > select > option[selected = "selected"]') === null) {
// Do not run this function outside gallery lists.
return;
} else if (window.location.href.includes('favorites')) {
if (document.querySelector('div.fp.fps > div[title = "' + BLACKLISTED_FAVORITE_CATEGORY + '"]') !== null) {
// Do not run this function when the blacklisted category has been selected on the favorites page for
// browsing. This allows the blacklist to be accessed and managed without polluting the full list of
// favorites, where galleries from all favorite categories are shown together.
return;
}
}
let blacklisted = [].slice.call(document.querySelectorAll('div[title = "' + BLACKLISTED_FAVORITE_CATEGORY +
'"][id ^= "posted_"]'), 0);
if (blacklisted.length > 0) {
blacklisted.forEach(function(favorite) {
let gallery = favorite.parentNode.parentNode;
switch (document.querySelector('#dms > div > select > option[selected = "selected"]').innerText) {
case 'Compact':
case 'Thumbnail':
gallery = gallery.parentNode;
break;
case 'Extended':
gallery = gallery.parentNode.parentNode;
}
gallery.parentNode.removeChild(gallery);
});
// Modify the "showing # results" message to mention how many galleries have been excluded by this function.
document.querySelector('p.ip:first-child').innerText += '. The blacklist userscript function excluded ' +
blacklisted.length + (blacklisted.length > 1 ? ' galleries' : ' gallery');
}
}
if (document.readyState === 'loading') {
window.addEventListener('DOMContentLoaded', onLoad);
} else {
onLoad();
}
This post has been edited by rraven314: May 23 2019, 22:49