fix: better tag filter
Also formatted it with biomejs
I didn't realize that Honkai Star R(ai)l has AI in it 💀
This commit is contained in:
parent
7e07d807d5
commit
c28408cabc
@ -5,7 +5,7 @@
|
|||||||
// @match *://www.pixiv.net/*
|
// @match *://www.pixiv.net/*
|
||||||
// @icon https://upload.wikimedia.org/wikipedia/commons/7/7e/Pixiv_Icon.svg
|
// @icon https://upload.wikimedia.org/wikipedia/commons/7/7e/Pixiv_Icon.svg
|
||||||
// @grant none
|
// @grant none
|
||||||
// @version 1.0.2
|
// @version 1.0.3
|
||||||
// @author tretrauit
|
// @author tretrauit
|
||||||
// @run-at document-idle
|
// @run-at document-idle
|
||||||
// @homepageURL https://gitlab.com/tretrauit/scripts
|
// @homepageURL https://gitlab.com/tretrauit/scripts
|
||||||
@ -19,9 +19,21 @@ function checkAI() {
|
|||||||
}
|
}
|
||||||
const tagElms = document.querySelectorAll(".gtm-new-work-tag-event-click");
|
const tagElms = document.querySelectorAll(".gtm-new-work-tag-event-click");
|
||||||
for (const elm of tagElms) {
|
for (const elm of tagElms) {
|
||||||
if (elm.parentElement.parentElement.textContent.toLowerCase().includes("ai")) {
|
const parentElm = elm.parentElement.parentElement;
|
||||||
|
for (const childElm of parentElm.children) {
|
||||||
|
const text = childElm.innerText.trim();
|
||||||
|
const textLowerCase = text.toLowerCase();
|
||||||
|
if (
|
||||||
|
text.startsWith("AI") ||
|
||||||
|
text.endsWith("AI") ||
|
||||||
|
textLowerCase === "ai" ||
|
||||||
|
(textLowerCase.includes("ai") &&
|
||||||
|
(textLowerCase.includes("generated") ||
|
||||||
|
textLowerCase.includes("illustration")))
|
||||||
|
) {
|
||||||
alert("AI artwork detected :(");
|
alert("AI artwork detected :(");
|
||||||
break;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user