rot.js resilience

This commit is contained in:
uwaa 2025-01-26 01:31:23 +00:00
parent d551e7f499
commit 6b9c7e3cbd

View file

@ -131,12 +131,19 @@
//Configure by post
waitUntilSpecial(".pin", (pinnedPost) => {
if (pinnedPost.nextElementSibling
.querySelector(".StatusBody")
.querySelector(".text")
.innerHTML
.replace(/(<([^>]+)>)/ig, '')
.search(/profile them/ig) == -1)
let p = pinnedPost.nextElementSibling;
if (!p)
return false;
let statusBody = p.querySelector(".StatusBody");
if (!statusBody)
return false;
let txtElm = statusBody.querySelector(".text");
if (!txtElm)
return false;
if (txtElm.innerHTML.replace(/(<([^>]+)>)/ig, '').search(/profile them/ig) == -1)
return false;
const ptp = pinnedPost.nextElementSibling.querySelector(".StatusBody");
@ -217,7 +224,7 @@
break;
case "notice":
//Continue playing
applyMainTheme(); //Statuses
break;
default: