From 528f19e5b5a18e59adc1d64411e8dbeadaa01077 Mon Sep 17 00:00:00 2001 From: tretrauit Date: Thu, 7 Mar 2024 00:09:31 +0700 Subject: [PATCH] fix: add delay --- userscripts/pixiv-ai-notifier.user.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/userscripts/pixiv-ai-notifier.user.js b/userscripts/pixiv-ai-notifier.user.js index 10f39c5..55c05c7 100644 --- a/userscripts/pixiv-ai-notifier.user.js +++ b/userscripts/pixiv-ai-notifier.user.js @@ -5,7 +5,7 @@ // @match *://www.pixiv.net/*/artworks/* // @icon https://upload.wikimedia.org/wikipedia/commons/7/7e/Pixiv_Icon.svg // @grant none -// @version 1.0.0 +// @version 1.0.1 // @author tretrauit // @run-at document-idle // @homepageURL https://gitlab.com/tretrauit/scripts @@ -13,10 +13,13 @@ // @downloadURL https://git.tretrauit.me/tretrauit/scripts/raw/branch/main/userscripts/pixiv-ai-notifier.user.js // ==/UserScript== -const tagElms = document.querySelectorAll(".gtm-new-work-tag-event-click"); -for (const elm of tagElms) { - if (elm.parentElement.parentElement.textContent.toLowerCase().includes("ai")) { - alert("AI artwork detected :("); - break; +console.log("AI notifier for Pixiv is running..."); +setTimeout(() => { + const tagElms = document.querySelectorAll(".gtm-new-work-tag-event-click"); + for (const elm of tagElms) { + if (elm.parentElement.parentElement.textContent.toLowerCase().includes("ai")) { + alert("AI artwork detected :("); + break; + } } -} \ No newline at end of file +}, 1000); \ No newline at end of file