- BrickPlanet Forum
- Game & Scripting Discussion
- I created a fix for forums stuck under review.
I created a fix for forums stuck under review.
Posted Oct 21st 2025 at 5:31AM
function replaceTextInDocument(searchText, replacementText) {
const treeWalker = document.createTreeWalker(
document.body,
NodeFilter.SHOW_TEXT,
null,
false
);
const textNodes = [];
let currentNode = treeWalker.nextNode();
while (currentNode) {
textNodes.push(currentNode);
currentNode = treeWalker.nextNode();
}
textNodes.forEach(node => {
if (node.nodeValue.includes(searchText)) {
node.nodeValue = node.nodeValue.replace(new RegExp(escapeRegExp(searchText), 'g'), replacementText);
}
});
}
function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}
function performReplacements() {
const urlMeta = document.querySelector('meta[property="og:url"]');
const descriptionMeta = document.querySelector('meta[property="og:description"]');
if (urlMeta) {
const urlContent = urlMeta.getAttribute('content');
const urlParts = urlContent.split('/');
const threadTitle = urlParts[urlParts.length - 1];
const formattedTitle = threadTitle
.replace(/-/g, ' ')
.replace(/\b\w/g, char => char.toUpperCase());
replaceTextInDocument('(Under Review)', formattedTitle);
}
if (descriptionMeta) {
const descriptionContent = descriptionMeta.getAttribute('content');
replaceTextInDocument('This post is under review', descriptionContent);
}
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', performReplacements);
} else {
performReplacements();
}
const treeWalker = document.createTreeWalker(
document.body,
NodeFilter.SHOW_TEXT,
null,
false
);
const textNodes = [];
let currentNode = treeWalker.nextNode();
while (currentNode) {
textNodes.push(currentNode);
currentNode = treeWalker.nextNode();
}
textNodes.forEach(node => {
if (node.nodeValue.includes(searchText)) {
node.nodeValue = node.nodeValue.replace(new RegExp(escapeRegExp(searchText), 'g'), replacementText);
}
});
}
function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}
function performReplacements() {
const urlMeta = document.querySelector('meta[property="og:url"]');
const descriptionMeta = document.querySelector('meta[property="og:description"]');
if (urlMeta) {
const urlContent = urlMeta.getAttribute('content');
const urlParts = urlContent.split('/');
const threadTitle = urlParts[urlParts.length - 1];
const formattedTitle = threadTitle
.replace(/-/g, ' ')
.replace(/\b\w/g, char => char.toUpperCase());
replaceTextInDocument('(Under Review)', formattedTitle);
}
if (descriptionMeta) {
const descriptionContent = descriptionMeta.getAttribute('content');
replaceTextInDocument('This post is under review', descriptionContent);
}
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', performReplacements);
} else {
performReplacements();
}
Posted Oct 22nd 2025 at 3:45PM
thats arleady fixed
Search Forum
Thread Info
Replies
1
Views
18