User talk:Cliffsend: Difference between revisions
From Soyjak Wiki, The Free Soycyclopedia
Jump to navigationJump to search
(unsure if cliffsend is still here though) |
No edit summary |
||
Line 10: | Line 10: | ||
glad you like my edits on the five board thing or something | glad you like my edits on the five board thing or something | ||
==4cuck.org== | |||
I have a userscript that automatically changes every instance of 4chan to 4cuck, which is probably what happened. --[[User:Angeleno|Angeleno]] ([[User talk:Angeleno|talk]]) 16:36, 12 June 2023 (EST) | |||
<pre> | |||
// ==UserScript== | |||
// @name 4cuck replacer | |||
// @namespace http://soyjak.party | |||
// @version 1.0 | |||
// @description Replaces the word "4chan" with "4cuck" on web pages | |||
// @match *://*/* | |||
// @grant none | |||
// ==/UserScript== | |||
(function() { | |||
'use strict'; | |||
const findAndReplace = () => { | |||
const elements = document.getElementsByTagName('*'); | |||
for (let i = 0; i < elements.length; i++) { | |||
const element = elements[i]; | |||
for (let j = 0; j < element.childNodes.length; j++) { | |||
const node = element.childNodes[j]; | |||
if (node.nodeType === 3) { // Text node | |||
const text = node.nodeValue; | |||
const replacedText = text.replace(/4chan/gi, '4cuck'); | |||
if (replacedText !== text) { | |||
element.replaceChild(document.createTextNode(replacedText), node); | |||
} | |||
} | |||
} | |||
} | |||
}; | |||
const replaceImageURL = () => { | |||
if (window.location.hostname === '4chan.org') { | |||
var images = document.getElementsByTagName('img'); | |||
for (var i = 0; i < images.length; i++) { | |||
var img = images[i]; | |||
var originalSrc = img.getAttribute('src'); | |||
if (originalSrc && originalSrc.indexOf('//s.4cdn.org/image/fp/logo-transparent.png') !== -1) { | |||
var newSrc = originalSrc.replace('//s.4cdn.org/image/fp/logo-transparent.png', 'https://files.catbox.moe/ril2hr.png'); | |||
img.setAttribute('src', newSrc); | |||
} | |||
} | |||
} | |||
}; | |||
findAndReplace(); // Initial replacement | |||
// Perform replacement on page updates | |||
const observer = new MutationObserver(findAndReplace); | |||
observer.observe(document.body, { | |||
childList: true, | |||
subtree: true, | |||
characterData: true | |||
}); | |||
replaceImageURL(); // Replace image URL on 4chan.org | |||
})(); | |||
</pre> |
Revision as of 16:36, 12 June 2023
newchad
update the statistics plot image
w
CLIFFSEND DO THIS
lol
glad you like my edits on the five board thing or something
4cuck.org
I have a userscript that automatically changes every instance of 4chan to 4cuck, which is probably what happened. --Angeleno (talk) 16:36, 12 June 2023 (EST)
// ==UserScript== // @name 4cuck replacer // @namespace http://soyjak.party // @version 1.0 // @description Replaces the word "4chan" with "4cuck" on web pages // @match *://*/* // @grant none // ==/UserScript== (function() { 'use strict'; const findAndReplace = () => { const elements = document.getElementsByTagName('*'); for (let i = 0; i < elements.length; i++) { const element = elements[i]; for (let j = 0; j < element.childNodes.length; j++) { const node = element.childNodes[j]; if (node.nodeType === 3) { // Text node const text = node.nodeValue; const replacedText = text.replace(/4chan/gi, '4cuck'); if (replacedText !== text) { element.replaceChild(document.createTextNode(replacedText), node); } } } } }; const replaceImageURL = () => { if (window.location.hostname === '4chan.org') { var images = document.getElementsByTagName('img'); for (var i = 0; i < images.length; i++) { var img = images[i]; var originalSrc = img.getAttribute('src'); if (originalSrc && originalSrc.indexOf('//s.4cdn.org/image/fp/logo-transparent.png') !== -1) { var newSrc = originalSrc.replace('//s.4cdn.org/image/fp/logo-transparent.png', 'https://files.catbox.moe/ril2hr.png'); img.setAttribute('src', newSrc); } } } }; findAndReplace(); // Initial replacement // Perform replacement on page updates const observer = new MutationObserver(findAndReplace); observer.observe(document.body, { childList: true, subtree: true, characterData: true }); replaceImageURL(); // Replace image URL on 4chan.org })();