jackmaxxd
Bronze
- Joined
 - Oct 15, 2025
 
- Posts
 - 253
 
- Reputation
 - 242
 
As the title states I made a simple script that lets you hide threads that are tagged as NSFW from being displayed. This is a script made in JS that can be installed following these steps. This should help keep people that are doing the NNN challenge from failing.
1. Install the extension called Tampermonkey (or an extension like it) for either your Firefox based browser or Chrome based browser
Chrome: https://chromewebstore.google.com/detail/dhdgffkkebhmkfjojejmpbldmpobfkfo?utm_source=item-share-cb
2. Click on the Tampermonkey icon and then create new script.
		
		
	
	
		
	
3. This opens the editor screen. Remove all the text in there by default and paste in the code of the NSFW blocker.
Link to script: (edit, i had to paste the code directly because pastebin links aren't allowed)
4. Then click ‘File’ and ‘Save’
5. Restart the looksmax.org webpage and you should see a button in the top right that lets you toggle on or off NSFW posts.
	
		
			
		
		
	
				
			1. Install the extension called Tampermonkey (or an extension like it) for either your Firefox based browser or Chrome based browser
Chrome: https://chromewebstore.google.com/detail/dhdgffkkebhmkfjojejmpbldmpobfkfo?utm_source=item-share-cb
2. Click on the Tampermonkey icon and then create new script.
	3. This opens the editor screen. Remove all the text in there by default and paste in the code of the NSFW blocker.
Link to script: (edit, i had to paste the code directly because pastebin links aren't allowed)
// ==UserScript==
// @name Hide NSFW Threads - Looksmax.org
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Toggle to hide/show NSFW threads on looksmax.org
// @author You
// @match https://looksmax.org/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Configuration
const STORAGE_KEY = 'nsfwToggleState';
const DEFAULT_HIDDEN = true; // Hide NSFW threads by default
// Get saved state or use default
function getToggleState() {
const saved = localStorage.getItem(STORAGE_KEY);
return saved !== null ? saved === 'true' : DEFAULT_HIDDEN;
}
// Save toggle state
function saveToggleState(hidden) {
localStorage.setItem(STORAGE_KEY, hidden.toString());
}
// Find all NSFW threads
function findNSFWThreads() {
const threads = document.querySelectorAll('.structItem--thread');
const nsfwThreads = [];
threads.forEach(thread => {
const nsfwLabel = thread.querySelector('.label--custom-nsfw');
if (nsfwLabel) {
nsfwThreads.push(thread);
}
});
return nsfwThreads;
}
// Hide or show NSFW threads
function toggleNSFWThreads(hidden) {
const nsfwThreads = findNSFWThreads();
nsfwThreads.forEach(thread => {
if (hidden) {
thread.style.display = 'none';
} else {
thread.style.display = '';
}
});
}
// Create toggle button
function createToggleButton() {
const button = document.createElement('button');
button.id = 'nsfw-toggle-btn';
button.textContent = getToggleState() ? 'Show NSFW' : 'Hide NSFW';
// Style the button
button.style.cssText = `
position: fixed;
top: 10px;
right: 10px;
z-index: 10000;
padding: 8px 16px;
background-color: #1a1a1a;
color: #ffffff;
border: 1px solid #444;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
transition: background-color 0.2s, border-color 0.2s;
`;
// Hover effect
button.addEventListener('mouseenter', () => {
button.style.backgroundColor = '#2a2a2a';
button.style.borderColor = '#666';
});
button.addEventListener('mouseleave', () => {
button.style.backgroundColor = '#1a1a1a';
button.style.borderColor = '#444';
});
// Click handler
button.addEventListener('click', () => {
const currentState = getToggleState();
const newState = !currentState;
saveToggleState(newState);
toggleNSFWThreads(newState);
button.textContent = newState ? 'Show NSFW' : 'Hide NSFW';
});
return button;
}
// Initialize the script
function init() {
// Wait for page to be ready
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', init);
return;
}
// Create and add toggle button
const button = createToggleButton();
document.body.appendChild(button);
// Apply initial state
const initialState = getToggleState();
toggleNSFWThreads(initialState);
// Watch for dynamically added threads
const observer = new MutationObserver((mutations) => {
let shouldCheck = false;
mutations.forEach((mutation) => {
if (mutation.addedNodes.length > 0) {
mutation.addedNodes.forEach((node) => {
if (node.nodeType === 1) { // Element node
// Check if a thread was added or if a thread container was modified
if (node.classList && node.classList.contains('structItem--thread')) {
shouldCheck = true;
} else if (node.querySelector && node.querySelector('.structItem--thread')) {
shouldCheck = true;
}
}
});
}
});
if (shouldCheck) {
// Reapply toggle state to any new threads
const currentState = getToggleState();
toggleNSFWThreads(currentState);
}
});
// Start observing
observer.observe(document.body, {
childList: true,
subtree: true
});
}
// Run initialization
init();
// Handle navigation (for SPAs that don't fully reload)
let lastUrl = location.href;
new MutationObserver(() => {
const url = location.href;
if (url !== lastUrl) {
lastUrl = url;
// Reapply toggle state after navigation
setTimeout(() => {
const currentState = getToggleState();
toggleNSFWThreads(currentState);
}, 500);
}
}).observe(document, { subtree: true, childList: true });
})();
4. Then click ‘File’ and ‘Save’
5. Restart the looksmax.org webpage and you should see a button in the top right that lets you toggle on or off NSFW posts.