Sirfetch’d
Guest
- 0
- Posts
rep return
:D
:D
rep return
:D
// ==UserScript==
// @name PokéCommunity Ignore
// @include https://www.pokecommunity.com/showthread.php?*
// @version 1
// @grant none
// ==/UserScript==
// Hover over an account name to find it's user ID.
// https://www.pokecommunity.com/members/[color=red]userId[/color]
// For example to hide myself, Wavee, and Her (the three previous posters in this thread) you'd use:
// const userIds = [451077, 629590, 92268];
const userIds = [];
userIds.forEach(id => {
document.querySelectorAll(`.post[data-userid="${id}"]`).forEach(post => {
// Remove the signature.
let signature = post.querySelector('.post-signature');
if (signature) signature.parentNode.removeChild(signature);
// Spoilerize the content.
let bodyContainer = post.querySelector('table > tbody > tr:nth-child(3)');
if (bodyContainer) {
let body = bodyContainer.querySelector('td');
if (body) {
let show = document.createElement('button');
show.appendChild(document.createTextNode('Show'));
show.addEventListener('click', _ => {
bodyContainer.removeChild(showContainer);
bodyContainer.appendChild(body);
});
let showContainer = document.createElement('td');
showContainer.appendChild(show);
bodyContainer.removeChild(body);
bodyContainer.appendChild(showContainer);
}
}
});
});