From 23717c098515e585a158168a9ff1c8dd27ba824a Mon Sep 17 00:00:00 2001 From: mic Date: Thu, 2 May 2024 23:59:42 +0200 Subject: [PATCH] ChatGPT-4 working even in a larger window. Related to #38 --- js/mzta-chatgpt.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/mzta-chatgpt.js b/js/mzta-chatgpt.js index 22fea733..a05d7838 100644 --- a/js/mzta-chatgpt.js +++ b/js/mzta-chatgpt.js @@ -208,8 +208,10 @@ function checkGPT4Model() { // Set up an interval that checks the value every 100 milliseconds const intervalId = setInterval(() => { // Get the '.text-token-text-secondary' element - const element = document.querySelector('.text-token-text-secondary'); + // const element = document.querySelector('div#radix-\\\\:ri2\\\\: > div > span.text-token-text-secondary'); + const elements = document.querySelectorAll('[id*=radix] span') + for(element of elements){ // Check if the element exists and its content is '4' if ((element && element.textContent === '4')||(force_go)) { console.log("The GPT Model is now '4'"); @@ -223,6 +225,7 @@ function checkGPT4Model() { clearInterval(intervalId); reject("Element not found."); } + } }, 200); }); }